Google Search Console is giving me the Duplicate without user-selected canonical error for URLs that contain an unnecessary double slash //
in them, like:
https://university.edu/~user//dir/
To avoid defining a canonical URL in the head of every index.html
file on the site, it would be nice to just add a URL rewriting rule in my .htaccess
file that would redirect all URLs with such a double-slash (not the initial double-slash after the https:
though) to the corresponding URL with a single slash. Is there are rewrite rule that would do this? And would this appease Google Search Console?