views:

63

answers:

5

I'm new in codeigniter. i have a project running perfectly in my localhost. when i deployed, my links seem to be broken. e.g. mysite.com displays the homepage without any error. now, i have a link let's say an about us link e.g. mysite.com/main/about where main is my controller and about is my function. the problem is the about us link is broken e.g. "Oops! This link appears to be broken." do you have any idea where did i go wrong? thank you for any positive response.

A: 

You have to make sure the links are either relative to the path or use the base_url() function provided by the URL helper. See URL Helper.

Josh K
+1  A: 

I'd check 2 things first.

  1. Your base site url is properly configured to either the correct url or $config['base_url'] = 'http://'.$_SERVER['HTTP_HOST'];
  2. Your .htaccess file is properly configured and you have the mod_rewrite apache module installed.
WeeJames
+2  A: 

It looks like you have configured your application to remove /index.php/ from your URLs, but I suspect you have not included the .htaccess file to provide mod_rewrite support.

If you want to exclude /index.php/ from your URLs, make sure you follow everything in this tutorial.

Or, to get your site working ASAP, restore the default value of index_page in system/application/config/config.php to:

$config['index_page'] = "index.php";
Dolph
A: 

i followed the suggestion of Dolph regarding this matter and went back to the default setting of $config[]. however, the link mysite.com/index.php/main/about_us gives this result "No input file specified. " and i cant figure out why. the project works well in my localhost. familiar with this error guys? thank you!

jaypee
A: 

Can you try to use this code below, hopefully it will works :)
RewriteEngine On
RewriteCond $1 !^(index.php)
RewriteRule ^(.+)$ index.php?$1 [L]

mandoy