I use this simple rule to remove index.php
from my site’s URLs :
RewriteRule ^.*$ ./index.php
So that http://example.com/index.php/user/me
becomes http://example.com/user/me
.
Do I need to add [R=301]
to avoid ‘content duplication’ issues from an SEO point of view?
2
Answers
You can add this rule to avoid that:
It’ll redirect requests made with the
/index.php
in it to the one without. Then the rule that you already have will internally rewrite the index.php back in.Just include link rel=”canonical” href=”http://example.com/ on every page and enjoy :).
Read more here https://support.google.com/webmasters/answer/139066?hl=en