CodeIgniter Forums
remove index.php from url - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 2.x (https://forum.codeigniter.com/forumdisplay.php?fid=18)
+--- Thread: remove index.php from url (/showthread.php?tid=70179)

Pages: 1 2


RE: remove index.php from url - InsiteFX - 03-24-2025

PHP Code:
// app/Config/App.php
public string $indexPage ''
Code:
## .htaccess
# Remove index.php from URL
RewriteCond %{HTTP:X-Requested-With}    !^XMLHttpRequest$
RewriteCond %{THE_REQUEST}              ^[^/]*/index\.php [NC]
RewriteRule ^index\.php(.*)$            $1 [R=301,NS,L]