Grandioso Posted November 12, 2010 Share Posted November 12, 2010 I have the same exact .htaccess file with the same exact application on a remote server and on localhost. One works without problems, one gives a "500 internal server error". What it should do is redirect any page ("domain.xx/link/to/page") to "domain.xx/index.php/link/to/page" (CodeIgniter does it this way). The problem is that it redirects everything, so even my css file gets redirected. So I tried to get around this with success on localhost. Here's my .htaccess : RewriteEngine on RewriteCond $1 !^(index\.php|design) RewriteRule ^(.*)$ index.php/$1 [L] Any idea how could I have the same functionality, with a code that works on the remote server or what can cause the problem ? Quote Link to comment https://forums.phpfreaks.com/topic/218529-ci-htaccess-problem/ Share on other sites More sharing options...
GKWelding Posted November 18, 2010 Share Posted November 18, 2010 to stop it doing mod-rewrite on css, js and images files you need to add the following 2 rewrite conditions to your htaccess file. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d So your new htaccess will look like this... RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index\.php|design) RewriteRule ^(.*)$ index.php/$1 [L] However, to be honest, I would just use the htaccess given here... http://codeigniter.com/wiki/mod_rewrite/ Quote Link to comment https://forums.phpfreaks.com/topic/218529-ci-htaccess-problem/#findComment-1136043 Share on other sites More sharing options...
Grandioso Posted November 19, 2010 Author Share Posted November 19, 2010 I'm sorry, this was already solved. I had to add "RewriteBase /", that's all Quote Link to comment https://forums.phpfreaks.com/topic/218529-ci-htaccess-problem/#findComment-1136858 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.