Fixing WWW Resolve Errors

Do you need help fixing www resolve errors? It is simple to do and can prevent search engines from considering www.example.com and example.com as two different websites.

To fix the error, you will need access to the .htaccess file in the root of your website. Please be sure to archive a copy the .htaccess before making any changes in case you make an error so that you can recover your website quickly.

# [ CP Global Redirection - Open ]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^nyhtml.com [OR]
RewriteCond %{HTTP_HOST} ^stephanpringle.com [OR]
RewriteCond %{HTTP_HOST} ^www.nyhtml.com
RewriteRule ^(.*)$ http://www.stephanpringle.com/$1 [R=301]
# [ CP Global Redirection - Close ]

The code is also useful for exterior websites that are sharing your IP address in their ‘A Record’ on purpose or accidentally and will let you redirect the visit to any URL (such as your affiliate links) of your choice.

# [ CP Global Redirection - Open ]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^veryvery.bad [OR]
RewriteCond %{HTTP_HOST} ^www.veryvery.bad
RewriteRule ^(.*)$ http://www.amazon.com/$1 [R=301]
# [ CP Global Redirection - Close ]

The following two tabs change content below.
facebook-profile-picture

Stephan Pringle

Technology Support Specialist at Sipylus
About The Author: Stephan Pringle is an Information Technology Support Specialist. He covers hardware and software and provides tips for you to troubleshoot and repair issues on your own. In his spare time, he writes articles about the State of New York on his Hackintosh and HackBook and that has helped him to become the top contributor of the New York City section of Yahoo! Answers.
facebook-profile-picture

Latest posts by Stephan Pringle (see all)

facebook-profile-picture

Stephan Pringle

About The Author: Stephan Pringle is an Information Technology Support Specialist. He covers hardware and software and provides tips for you to troubleshoot and repair issues on your own. In his spare time, he writes articles about the State of New York on his Hackintosh and HackBook and that has helped him to become the top contributor of the New York City section of Yahoo! Answers.