CodeIgniter Forums
.htaccess solution - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: .htaccess solution (/showthread.php?tid=75281)



.htaccess solution - stlake2011 - 01-21-2020

Hi all,

I have been using CI 3.1.x for a while so now that CI4 is in its final stages before full release I decided to download and get familiar with it. 

Anyway I wanted my urls to look like this (before using routing rules):
https://localhost/controller/method
but had to do it this way:
https://localhost/index.php/controller/method

To make a long story short. The .htaccess was not loading and after a couple of hours of digging online and trying various "solutions" found here and in other forums, I found a solution that actually worked (for me anyway, for you all you can do is try it yourself):

<Directory /path/to/your/working/directory>
AllowOverride ALL
</Directory>

Not sure its entirely safe (security wise) but wanted to put this out there for those having similar issues with getting the .htaccess load properly.

Oh one more thing as I am testing in a test virtual host, I placed the directory above in that vhosts configuration. But imagine it would work as well in the httpd.conf file if needed.

Hope this helps.