I want to make my URLs clean, for example:
http://sample.com/about-me
instead of: http://sample.com/about-me.php
This is my code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php
But I can still access http://sample.com/about-me.php
.
How can I have http://sample.com/about-me
, so http://sample.com/about-me.php
will be permanently redirected to that?
I think this technique is good for SEO because canonicalization needs just one URL. If I use two URLs that both can be accessed, I think that's not good for SEO and can make search engines confused, right?