Search code examples
.htaccesshttp-redirectno-www

www redirect with double slash


When I enter my website http://domain.com it redirects to http://www.domain.com// (double slash in the end).

What is strange, I haven't set any redirects in .htaccess file. Actually that file is empty. I've tried to add some rewrite rules there, but the same problem appeared again.

I can't understand where have been set that non-www to www redirect? Do you have any ideas.

Thanks.


Solution

  • Try using this code to remove double slashes from the urls.

    RewriteEngine On
    RewriteBase /
    RewriteCond %{THE_REQUEST} //
    RewriteRule ^ $0 [R=302]
    

    Change the 302 to 301 once you get it working.