View Full Version : Redirecting requests
Rosco
07-27-2011, 03:00 PM
hey everyone how do i resolve non-preferred hostname on my website. I use 1 and 1 webhosting. any help is appreciated!
Craven_Morehead
07-27-2011, 08: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
Rosco
07-28-2011, 01:19 AM
thanks got it to work! Really appreciated it!
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.