Removing index.php and first segment |
[eluser]Unknown[/eluser]
Is this even possible? (I can't seem to get it to work.) Right now I'm trying to remove index.php and the first segment of the url. when someone goes to http://www.example.com/ they get the main page without the index.php/main/ when they click on my "About Us" link, they go to http://www.example.com/index.php/main/about_us/ I can get rid of the index.php, but I'm having issues for some reason getting the /main part to disappear as well. I'm sure it's something small that I'm missing, but I can't seem to figure out what. (the current site, which I'm still working on is at haywoods.travislittlechilds.com if that helps at all. edit: My .htaccess file is: Code: RewriteEngine on I just get 404's on any of my links, where I should get basic pages (just saying "Menu Page" essentially)
[eluser]Unknown[/eluser]
Code: RewriteEngine On This will work. Put this in the .htaccess file in the root of CI.
[eluser]Unknown[/eluser]
Thank you very much, if you have a minute would you mind explaining it, so I know for future? (I kind of hate just copy pasting code) From what it looks like it does the same as mine, with the addition of rewriting the system and application links, correct?
[eluser]Bart v B[/eluser]
Dit you also remove the index.php from your application/config/config.php? Code: /* EDIT my .htaccess: Code: <IfModule mod_rewrite.c>
[eluser]Aken[/eluser]
Is every single one of your pages routed through a controller named "main"? If so, you can use the .htaccess file that Bart v B has shown, and then set up a route to handle the "main" part. Code: $routes['(:any)'] = 'main/$1'; |
Welcome Guest, Not a member yet? Register Sign In |