I want to redirect normal pages so that users and 开发者_StackOverflowbots don't access the domian.com/index.php/pagename version of the pages.
I am currently using this solution:
RewriteCond %{THE_REQUEST} ^.*index.php.*
RewriteRule ^(.*)index.php(.*)$ $1$2 [NC,R=301,L]
This however also redirects domain.com/admin/index.php/variables which stops me being able to access the admin area.
So, how to redirect domain.com/index.php/pagename to domain.com/pagename without affecting domain.com/admin/index.php/variables
The RewriteRule
command is pointing any URL with 'index.php' in it to another page. Try changing the second command to:
RewriteRule ^(index.php)(.*)$ /$1 [NC,R=301,L]
精彩评论