Forum Moderators: phranque
RewriteRule ^([^/]+/)*([^/.]+\.)html/ - [G]
# Externally redirect requests to remove "extra" URL-path info appended after htm, html,
# shtm, or shtml filetypes due to bad links on other sites. This should prevent those bad
# links from appearing in search results, as long as the bad links on not on my own site.
RewriteRule ^(([^/.]+/)*[^.]+\.s?html?)/ http://www.example.com/$1 [R=301,L]
Yes, don't use relative linking!
A URL with a trailing slash or double slash that does not exist redirects to my 404 page with a 301.
Why does it redirect?
http://mysite.com/category/page/4 http://mysite.com/category.html/page/4 http://mysite.com/category-blue/page/4 http://mysite.com/category_blue/page/4 http://mysite.com/view/blue/page/4 http://mysite.com/view-blue/page/4