The offending URLs are:
The .htaccess rule I have for these types of URLs looks like:
RewriteRule ^face/(.*)$ face.php?term=$1
What can I do to make both of these URLs to go to the same page?
A 301 redirect is the best way to resolve duplicate content issues caused by trailing slashes. If you're just fixing one page, you'd redirect the duplicate copy to the version that matches your chosen URL structure. Most trailing slash issues however, affect many pages across a website.
Historically, a trailing slash marked a directory and a URL without a trailing slash at the end used to mean that the URL was a file. Today, however, trailing slashes are purely conventional, and Google does not care whether you use them; as long as you're consistent.
Always use trailing slashes for any resource that may contain children. Just consider "GET" on a public_html directory with files.
You can use this:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ /$1 [L,R=301]
The first line says: "if it's not a directory" (because then a trailing slash would have meaning). The second line says: redirect everything from start to the trailingslash and end to everything that was in there, without the trailing slash.
Put your own RewriteRule
in there (below that one, not above) so your normal redirect still works after the trailing slash was removed.
(this one will obviously work for /body/
too, and not only for /face/
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With