Monday, May 14, 2012

Use .htaccess to remove double slash from URL

In order to remove double or multiple slash from your URL using only .htaccess you can use following code:

RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]

1 comment:

  1. Excellent!

    Of all the similar methods I've tried this seems to be the most functional. Thank you.

    ReplyDelete