RewriteRule ^about$ about/about_me.html [L]
#Using multiple RewriteRules with diffrent names for same url
RewriteRule ^About$ about/about_me.html [L]
RewriteRule ^ABOUT$ about/about_me.html [L]
Yes, you can do this, but... you shouldn't.
/about
and /ABOUT
are strictly speaking different URLs. (URLs are case-sensitive.) Google sees these as different URLs, so if /about
and /ABOUT
both serve the same content then you are potentially creating a duplicate content issue (whether that is actually going to be a problem or not is another matter).
Aside: You don't need multiple directives to do this, creating another directive for each variation. You can use the NC
(nocase
) flag on the RewriteRule
directive to make it a case-insensitive match. For example:
RewriteRule ^about$ about/about_me.html [NC,L]
This will match about
, ABOUT
and AbOuT
etc. and rewrite the request to about/about_me.html
in all cases.
Case-insensitive and avoid duplicate content - Redirect instead
To allow all cased variations of about
to be accessible and avoid the duplicate content issue you should externally redirect (not "rewrite") the non-canonical variations (eg. ABOUT
and AbOuT
etc.) to the canonical about
. And only rewrite about
to about/about_me.html
.
For example, before the above "rewrite" you could implement the following "redirect" to canonicalize ABOUT
and AbOuT
to about
.
# Redirect "ABOUT" and "AbOuT" to "about"
RewriteCond %{REQUEST_URI} ^/about$ [NC]
RewriteRule [A-Z] /about [R=301,L]
However, this rule is specific to one URL - it is not very practical if you have more than a handful of URLs. You might instead choose to simply lowercase all requested URLs. For example: