1

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> 
5
  • It looks like you are new here, welcome! Did you check the related answers on the right side? Commented Jan 16, 2014 at 9:29
  • Do you have rewrite module active on your server ? Commented Jan 16, 2014 at 9:40
  • yep i did i will just confirm if rewrite module is available Commented Jan 16, 2014 at 9:49
  • post your config settings for uri_protocol Commented Jan 16, 2014 at 10:19
  • my config settings for uri protocol are default i tried all the alternatives provided to no avail so just returned them to AUTO Commented Jan 16, 2014 at 11:43

1 Answer 1

2

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

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

1 Comment

am greatful this htacces seems to work. can u please tell me whwt was wrong with my htaccess?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.