[solved] Noob Question: removing index.php from URL... fresh CI installation |
[eluser]Fenix[/eluser]
Okay, first of all, I'm new to CI... BRAND new. I started going through the user guide and right away things aren't so clear to me >.< I want to remove the index.php from my URLs. I'm unsure where the .htaccess file goes, if there is already one there on a fresh install, and what exactly should it do. I searched in these forums but could only find solutions in the context of other user's specific needs. I have a fresh installation of CI so if somebody could tell me exactly where the file goes and what should be in it, that would be great. Thanks ^__^
[eluser]Fenix[/eluser]
Ok, I missed a bit when I read through the user guide. So I made a .htaccess file in my site root (same place as my index.php) with the following: Code: RewriteEngine on I also changed the line in my config to: Code: $config['index_page'] = ""; Now I get a 404 Not Found Quote:Not Found
[eluser]Xeoncross[/eluser]
Read This thread for more help with your .htaccess file. I bet that you are having a problem with your: Code: # The RewriteBase of the system (if you are using this system in a sub-folder).
[eluser]Fenix[/eluser]
My CI installation is in a folder under the domain I use for my projects... Code: // system folder...
[eluser]Fenix[/eluser]
i guess this Code: RewriteRule ^(.*)$ /index.php/$1 [L] Code: RewriteRule ^(.*)$ index.php$1 [L] but i dont know if this will cause problems down the line since it isn't adding a slash to the end... idk... i guess i will find out
[eluser]Fenix[/eluser]
Just as I expected I am getting a 404 Code: The requested URL /si/index.phphelloworld was not found on this server. helloworld is a controller like in the user guide Code: <?php How do I get the slash to show up there?
[eluser]Xeoncross[/eluser]
[quote author="Fenix" date="1218062174"]My CI installation is in a folder under the domain I use for my projects... [/quote] So then you would need: Code: #RewriteBase / Lets say your filesystem looks like this: /root/www/mydomain.com/ and your Codeigniter file system path is: /root/www/mydomain.com/projectname/index.php/ Your htaccess file would be: Code: RewriteBase /projectname/ mydomain.com/controller/method would point to /root/www/mydomain.com/projectname/index.php/controller/method
[eluser]Fenix[/eluser]
Thanks but the thread you linked to in your first reply turned out to be exactly what I needed to make it work. I didn't have to make any mods to the script from that thread. |
Welcome Guest, Not a member yet? Register Sign In |