Double Slash (//) Issue in URLs Despite Applied Rewrite Rules
Hi,
We are experiencing a persistent double-slash (//) issue in our website URLs, which are also getting indexed by Google. An example of the problematic URL is -: https://mywebsite.com//content/site/en/learn/about-us/company-overview.html
We have applied the following Rewrite Rules in our dispatcher
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule ^ %1/%2 [R=301,L]
RewriteRule ^/$ /content/site/en.html [R=301]
RewriteRule ^/en(.*)$ /content/site/en$1 [R=301]
RewriteRule ^/content/site/en$ /content/site/en.html [R=301,L]
Additionally, we also tried the following alternative rules:-
RewriteCond %{REQUEST_URI} ^//+
RewriteRule ^(//+)(.*)$ /$2 [R=301,L]
RewriteCond %{REQUEST_URI} ^//content/site/en(.*)$
RewriteRule . /content/site/en$1 [R=301,L]
Despite these rules, we still see URLs with double slashes getting generated and indexed. These are also appearing in the Google Search Console under the list of crawled URLs.
Are there any potential issues with the above rules that could allow double slashes to persist or Is there any configuration in Sling Mappings, Dispatcher Settings, or AEM Resource Resolver that could be conflicting with these rules?
Any guidance to resolve this would be appreciated. Thanks in advance!