I decided to convert all my dynamic pages to static pages URLs. I used to have "/contactUS.php" and now I want the page to be served as "/contact-us".
I used to following rule n .htaccess:
RewriteRule ^contact-us contactUS.php [NC,L]
It all works fine, but the problem is that I want to prevent entrance to "/contactUS.php" to aviod duplicate content. Of course that adding the following rule:
RewriteRule ^contactUS.php contact-us [NC,L]
creates an infinite loop. What is the best way to achieve the goal, also taking SEO into account?
This causes an infinite loop:
RewriteRule ^contact-us contactUS.php [NC,L] RewriteRule ^contactUS.php contact-us [NC,R=301]