I know there have been plenty of "remove trailing slash" via Apache URL rewriting questions on here, but I still haven't found a way (via RewriteCond/RewriteRule or RedirectMatch) to do what seems to be a really simple trailing-slash redirect for only the root url on the host:
http://www.example.com/ -> http://www.example.com
The only reason I want to do this is for SEO - I've been told that redirecting to a single canonical home URL is the way to go for google's crawler.
The problem is that ${REQUEST_URI} ALWAYS contains a slash (meaning the 2 URLs above have identical ${REQUEST_URI} values of /), and RewriteRule / RedirectMatch operate off of ${REQUEST_URI}. RewriteCond can use other server variables, but I don't see one that just matches the entire URL with the host AND the empty request.
Since I can't differentiate between / and empty, I can't remove the trailing slash without causing an infinite redirect loop.
# Causes infinite redirect loop
RewriteRule ^(.*)/$ $1 [R,L]
Any thoughts on how to do this? Is this something extremely simple that I'm just missing?
/
. You talk about indexed textual fields of link-tags. – Deadooshka