Reputation: 33
how to remove index.php in my url
my htaccess is
RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
i visit my site as http://domain.com/index.php
it redirects to http://domain.com
How could I solve this problem?
Upvotes: 1
Views: 107
Reputation: 1989
try this,
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.php($|\ |\?)
RewriteRule ^ /%1 [R=301,L]
Upvotes: 1