CodeIgniter Forums

Full Version: Remove index.php from URLs?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
There are lots of questions about how to remove index.php to make URLs more search-engine friendly.
Should this be done out of the box, rather than providing instructions on how to do it?

CI could come with a .htaccess file inside the document root, and the user guide could then explain how to accomplish the same for non-Apache servers.

Disclaimer: Putting forward an idea without implying any endorsement of it.
No, lot of servers don't have htaccess support enabled by default and boot of the app like this fails
You need to have mod_rewrite installed and enabled for this to work. That's not "newbie friendly", because this module is not installed by default when you install Apache. And what about other web server (nginx, IIS...), do they use .htaccess or something else?
I think the documentation should contain the description how to enable SEF URL's in case of different servers (Apache - .htaccess, IIS - web.config and so on) but the distribution should not contain any of the config files because we don't know what will be the hosting environment. For example the nginx is getting more and more traction in the recent years maybe later on it will surpass Apache's popularity.
I think that there should be a predefined .htaccess and help document about that and with information how to set it to their server apache and others..

CI should focus on Good Practices and to cover all other cases not the opposite..
Friendly urls are a good practice so they should be our default target.. But of course if its not available CI should work without a problem..
Here is an interesting answer:
Creation of .htaccess is not newbie friendly, indeed.
At least have it an option in the config. But totally agree remove it!
in my opinion we should remove the index.php extension from the website urls. So the users can type it very easily and search engines will display the result correctly.
(04-15-2015, 11:22 AM)FlexIndie Wrote: [ -> ]At least have it an option in the config. But totally agree remove it!

It's more complicated than an option in the config ! You need a .htaccess file and the mod_rewrite module.
Mmmm this is a difficult one. I think that CodeIgniter should work out-of-the-box in as much setups as possible. On the other hand, this is a typical issue, so I think that there should be some default options here. First of all, the documentation. But, in addition, I think CodeIgniter should come with a default .htaccess or even for other web servers with the index.php removed. For that, maybe we could provide a commented one.
Pages: 1 2