CodeIgniter Forums
Remove index.php from URLs? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forumdisplay.php?fid=29)
+--- Thread: Remove index.php from URLs? (/showthread.php?tid=61378)

Pages: 1 2


Remove index.php from URLs? - jlp - 04-11-2015

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.


RE: Remove index.php? - gadelat - 04-11-2015

No, lot of servers don't have htaccess support enabled by default and boot of the app like this fails


RE: Remove index.php from URLs? - includebeer - 04-12-2015

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?


RE: Remove index.php from URLs? - orionstar - 04-12-2015

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.


RE: Remove index.php from URLs? - sv3tli0 - 04-12-2015

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..


RE: Remove index.php from URLs? - ivantcholakov - 04-15-2015

Here is an interesting answer: http://forum.codeigniter.com/thread-61341-post-316203.html#pid316203
Creation of .htaccess is not newbie friendly, indeed.


RE: Remove index.php from URLs? - FlexIndie - 04-15-2015

At least have it an option in the config. But totally agree remove it!


RE: Remove index.php from URLs? - alkarim - 04-16-2015

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.


RE: Remove index.php from URLs? - includebeer - 04-18-2015

(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.


RE: Remove index.php from URLs? - Razican - 04-19-2015

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.