Quantcast
Channel: Redirect double-slash "//" URLs using a rewrite rule in the .htaccess file - Webmasters Stack Exchange
Viewing all articles
Browse latest Browse all 2

Redirect double-slash "//" URLs using a rewrite rule in the .htaccess file

$
0
0

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?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images