CodeIgniter Forums
Remove index.php without .htaccess - 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 without .htaccess (/showthread.php?tid=68302)



Remove index.php without .htaccess - krystian2160 - 06-21-2017

It would be great to have no index.php in address without needing of .htaccess file with


Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

I don't like it.  Confused


RE: Remove index.php without .htaccess - Martin7483 - 06-21-2017

Not possible. How will the server know what it should do with the incoming request?


RE: Remove index.php without .htaccess - mirivlad - 06-21-2017

(06-21-2017, 06:21 AM)krystian2160 Wrote: It would be great to have no index.php in address without needing of .htaccess file with


Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

I don't like it.  Confused

If you are using a nginx server, then you can do it without .htaccess, but then you need to configure the config file for nginx


RE: Remove index.php without .htaccess - skunkbad - 06-21-2017

Like it or not, it's just the way Apache servers work.

If you don't want to use .htaccess, you could edit the apache conf file, or maybe if you're using virtual hosts edit the site's conf file. You're going to need to do something so the server knows what to do. It's not magic.