Reputation: 389
I have a question that has had me pulling my hair over the last few weeks.. i have been having a blast developing a Codeigniter
website on my local machine and everything functions as normal on the local machine, however when i upload the site to the production server then the links stop working and whenever clicked give me a 500 internal server error also ajax post requests also generate a 500 internal error from the console. I m really stumped as to what the problem could be thats why i have come to ask here, could anybody help me please. Also i don't have shell access
this is my htaccess
file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
Upvotes: 1
Views: 762
Reputation: 2852
use this as .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^sys.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^app.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
assumming that index.php is your index page.
and change in config.php
$config['index_page'] = '';
if you are using sub domain set it as the RewriteBase
Upvotes: 2