I got an alarming number of pages not found at my site because of presence of two forward slashes in the URL. I am unable to located the exact source of the link.
Here is the example.
http://www.example.com/dir_name//page1.php
This should be redirected as
http://www.example.com/dir_name/page1.php
I have one .htaccess file at root of my site which redirects example.com to www.example.com. ( this is working )
I have added these few lines to it ( learnt from here one old post ) but it is not working, cleared my cache also and tried.
Please help me , what is wrong here.
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
# Externally redirect to remove multiple contiguous slashes embedded in URL
RewriteCond %{REQUEST_URI} ^/([^/]+)//+(.*)$
RewriteRule // http://www.example.com/%1/%2 [R=301,L]
I am keeping this file at root of the site. Should I keep each one at every dir ?