View Full Version : Redirecting requests

07-27-2011, 04:00 PM
hey everyone how do i resolve non-preferred hostname on my website. I use 1 and 1 webhosting. any help is appreciated!

07-27-2011, 09:24 PM
Hey, I'm going to assume you're using Apache. (If not, don't attempt this!)

To get rid of the non www (non preferred) all you need to do is a 301 redirect.

Ftp into your site, then in the public_html folder, look for .htaccess

If there isn't one already, make one. Inside, copy and paste this in:

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

Make sure you change the "yoursite" to your domain.

Then save it, and you're all done :)

Now when someone visits http://yoursite.com they will automatically be taken to http://www.yoursite.com

07-28-2011, 02:19 AM
thanks got it to work! Really appreciated it!