htaccess - remove “index.php” from URL and redirect with exclusion

htaccess - remove “index.php” from URL and redirect with exclusion

You can use this rule in your root .htaccess:

RewriteEngine On

RewriteCond %{THE_REQUEST} /index\.php [NC]
RewriteRule ^(.*?)index\.php(?:/(.*))?$ /$1$2 [L,R=302,NC,NE]



Share on Pinterest
Share on LinkedIn
Share on WhatsApp
Share on Telegram