0

i have problem about .htaccess file for my codeigniter installation. On localhost this work fine, when i upload online its rewrite URL but the website not work.

this is my htaccess on localhost:

RewriteEngine On
RewriteBase /jCore_01/
#RewriteBase /

### Canonicalize codeigniter URLs

# If your default controller is something other than
# "welcome" you should probably change this
RewriteRule ^(welcome(/index)?|index(\.php)?)/?$ / [L,R=301]
RewriteRule ^(.*)/index/?$ $1 [L,R=301]

# Removes trailing slashes (prevents SEO duplicate content issues)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ $1 [L,R=301]



# Enforce NO www
#RewriteCond %{HTTP_HOST} ^www [NC]
#RewriteRule ^(.*)$ http://domain.tld/$1 [L,R=301]



RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

online i have a problem: i put this file on subdomain jcore.miodomio.com and it rewrite URL but not work

example: without htaccess it's work: jcore.miodominio.com/index.php/en/home

with htaccess jcore.miodominio.com/en/home

Not Found

The requested URL /en/home was not found on this server.

can anyone help me? suggestion? regards

Denny

0

2 Answers 2

1

Try change your htaccess to:

RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?/$1 [L]

Sign up to request clarification or add additional context in comments.

5 Comments

sorry, i dont write that i just removed it
in application/config/config.php in line 14 $config['index_page'] = '';
can u send the subdomain which have the problem so that i can help.
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?/$1 [L]
try this htaccess . if it work may i see what in your htacess
0

Somethings to consider.

  1. Did you enable Apache rewrite module?
  2. If enabled check whether your virtual host file is configured properly So to make sure its hitting .htaccess or try putting some dump on .htacess , So if its hitting .htaccess than you should get an 500 server error.

If you are not getting error than its mostly the problem in your host settings.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.