Reputation: 11
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.
Upvotes: 1
Views: 1163
Reputation: 1
Can you try to use this code below, hopefully it will works :)
RewriteEngine On
RewriteCond $1 !^(index.php)
RewriteRule ^(.+)$ index.php?$1 [L]
Upvotes: 0
Reputation: 50650
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";
Upvotes: 2
Reputation: 540
I'd check 2 things first.
Upvotes: 1
Reputation: 28883
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.
Upvotes: 0