htaccess redirect double slash in url

by Ramya 2014-03-19 20:41:45

htaccess redirect double slash in url:

in some cases, you may face 404 issue by adding "//" in your url, like,
http://yourdomainname.com/(folder1)/(folder2)//index.php

to avoid this, you can use htaccess redirection by just adding the following code,
RewriteCond %{REQUEST_URI} ^(.*)/(.*)//(.*)$
RewriteRule . %1/%2/%3 [R=301,L]



You can change the path accordingly, for eg, if you want to redirect double slash after second directory, then
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]


Razz
Razz
689
like
0
dislike
0
mail
flag

You must LOGIN to add comments