Wordpress is not re-directing non-www to www

by lovboa Banned
3 replies
All of my other wordpress sites are redirecting automatically after I applied it in the settings.

However, my new site I created the same way but it is not redirecting.
Could somebody please give me some advice on how to fix this?

Thank you.
#nonwww #redirecting #wordpress #www
  • Profile picture of the author tq
    Redirect from http://www.domain .com to http://domain .com put the below in your htaccess file

    It uses a “301 redirect” to establish a permanent redirect from the www-version of a domain to its non-www version.


    # permanently redirect from www domain to non-www domain
    RewriteEngine on
    Options +FollowSymLinks
    RewriteCond %{HTTP_HOST} ^www\.domain\.tld$ [NC]
    RewriteRule ^(.*)$ http://domain.tld/$1 [R=301,L]


    or use redirect from the non-version of a domain to its www- version.

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^domain.com$
    RewriteRule ^(.*)$ "http\:\/\/www\.domain\.com\/$1" [R=301,L]


    Let me know if you have any questions? I will try to help.
    {{ DiscussionBoard.errors[7345121].message }}
  • Profile picture of the author lovboa
    Banned
    Thanks tq! It worked perfectly.
    {{ DiscussionBoard.errors[7345249].message }}
  • Profile picture of the author locke815
    Try a redirect plugin in future.
    {{ DiscussionBoard.errors[7346496].message }}

Trending Topics