Remove // after domain name using htaccess

Viewed 22

i have site there both url are working as follow

https://domainname/abc

https://domainname//abc

so i just want to redirect //abc to 404 error page for preventing duplicate content i try following rule but didn't work.

RewriteRule ^//(.*)$ 404
ErrorDocument 404 https://domain_name/404

i also try using RedirectMatch as follow

<IfModule mod_alias.c>
    RedirectMatch 404 ^//(.*)$ https://domain_name/$1
</IfModule>
0 Answers
Related