• I am trying to redirect all traffic from ‘www.mysite.com’ to http://mysite.com by editing the .htaccess file.

    However, I am not sure which lines to edit/delete and which ones to add. I tried solutions found on different blogs but none of them did the trick.
    This is my current (and I imagine the standard) /htaccess file:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
Viewing 1 replies (of 1 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    That’s odd. I would think that the canonical URL feature of WordPress would take care of that.

    Try this: above those lines in the .htaccess file try add these lines:

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} www\.mysite\.com [NC]
    RewriteRule ^(.*)$ http://mysite.com/$1 [R=301,L]
    </IfModule>

    That will make the requests for http://www.mysite.com get 301 redirected to the non-www version.

Viewing 1 replies (of 1 total)
  • The topic ‘How to redirect www to http thro htaccess’ is closed to new replies.