Codeigniter: Routes only visible when entering /index segments
I'm working on my first project with codeigniter 2.0 and have a bit of a problem. On my localhost (a MAMP installation) everything works fine with the routes. Only when i add a copy on my domain, change the base url and other necessary settings like my dat开发者_StackOverflow社区abase settings it works fine for like 99%. I can't access my other controllers directly without adding the /index route. For example when i want to visit the http://my_domain.com/work it'll open the 404 error page but when i enter ttp://my_domain.com/work/index it works fine. Does someone know a setting i have to change for the online version? The Htaccess files are identical.
CHeers in advance.
I found my solution. I just checked the routes.php file in my config where i added a route for every controller. I just removed these and only my default_controller route is left. Now it works fine. Just a codeigniter newbie issue.
Thanks anyways for the help @Hibiscus and @BigFatBaby
I sorted my problem by setting the following line as my .htaccess file.
RewriteEngine On
RewriteRule ^.*$ index.php [NC,L]
It'll rewrite anything after the /index.php/blaha to /blaha.
精彩评论