How do I remove the "index.php"
sticking out in every path in codeigniter somewhere in the center?
I want clean non index.php-fied URLs
?
|
|||
|
If you are using Apache place a .htaccess file in your root web directory containing the following:
Another good version is located here: |
|||||
|
I had some big issues with removing the index.php. As a general rule the .htaccess below has been tested on several servers and generally works:
If you don't have any luck with that then the next step is to adjust your config file. Try some of the other URI protocols e.g.
If your still not having any luck try changing the rewrite rule to include your subfolder. This is often a problem if your using a temporary URL on a dev server etc:
Just play around with these options, one should work. Also, make sure your index file is set to:
Good luck! |
|||||||
|
Have a look in the It should look like this
change it to
Then as mentioned you also need to add a rewrite rule to the Note: in CodeIgniter v2 this file was moved out of the system folder to |
||||
|
Have the.htaccess file in the application root directory, along with the index.php file. (Check if the htaccess extension is correct , Bz htaccess.txt did not work for me.) And Add the following rules to .htaccess file,
Then find the following line in your application/config/config.php file
Set the variable empty as below.
That's it, it worked for me. If it doesn't work further try to replace following variable with these parameters ('AUTO', 'PATH_INFO', 'QUERY_STRING', 'REQUEST_URI', and 'ORIG_PATH_INFO') one by one
|
|||||||||||||
|
This must definitely work.. have a try |
|||
|
This is an .htaccess for one of my CI projects:
The last line should give you what you need, though you may or may not need '/projectFolder' depending on how your folder structure is set up. Good luck! |
|||
|
Use |
||||
|
Just thought i might add
would be the .htaccess and be sure to edit your application/config.php variable in the following manner: replace
with
|
|||
|
All above methods failed for me and then I found that I was not changing AllowOverride None to AllowOverride All in my virtual host file at /etc/apache2/sites-available/default
|
|||||||||||||
|
|
|||
|
place a .htaccess file in your root web directory Whatsoever tweaking you do - if the above is not met - it will not work. Usually its in the System folder, it should be in the root. Cheers! |
|||
i tested this on apache2 on many different hosting and it works great. use this htaccess
be sure you have then do this in config/config.php:
if it doesn't works yet, try to change the sometimes i used : |
||||
|
Ensure you have enabled
Also, replace
Finaly...
My .htaccess is
|
||||
|