How to remove index.html and/or index.php from the URL

Here is mine with RewriteEngine On (works on this hosting and both versions of GoDaddy hosting plans example1.com and example1.com/index.html/example2.com/index.php)

//# This will remove index.html AND index.php from URL
RewriteCond %{THE_REQUEST} /index.(php|html) HTTP [NC]
RewriteRule (.*)index.(php|html)$ /$1 [R=301,L]

Leave a Reply