CodeIgniter Forums
mod_rewrite what is it and what does it affect? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: mod_rewrite what is it and what does it affect? (/showthread.php?tid=80572)



mod_rewrite what is it and what does it affect? - richb201 - 11-17-2021

I was told by someone reviewing my issue with my website that the problem is with the lack of setting mod_rewrite. What is the affect of mod_rewrite on CI3 on an apacheĀ  web server?


RE: mod_rewrite what is it and what does it affect? - includebeer - 11-17-2021

It allows you to redirect an url to a file without having the filename in the url. With CodeIgniter you need mod_rewrite to remove index.php from the url. The rules in .htacess will tell Apache to redirect the queries to index.php, which is the front controller. ReadĀ this page: https://codeigniter.com/userguide3/general/urls.html?highlight=mod_rewrite#removing-the-index-php-file

So you can have something like
Code:
http://localhost/blog/whatever
...instead of
Code:
http://localhost/index.php/blog/whatever