Bluehost : 301 Redirect in .htaccess
By bluehost on Jun 28, 2007 in Bluehost Blog
Host unlimited blogs, websites for $4.95 only with this web host
Register domain names for less than a dollar here
Get a VPS or dedicated server for less than $50 Signup Now
Bluehost is among our best web hosts. Sign up with bluehost here
This is a bluehost question posted by Rodrigo on 26 June 2007
I want to set www version as my prefered domain (redirecting non-www version to www version). I’ve found 2 ways to do this with .htaccess.
First way:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]Second way:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^(.*)\.yoursite\.com$ [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]Which one is correct?
You can read more about bluehost in detail or sign up now with bluehost web hosting
Related Posts :- Bluehost : Addon and subdirectory question
- Bluehost : htaccess help
- Bluehost : Redirect-Thought this was fixed HELP!
- Bluehost : Make domain.com point to www.domain.com
- Web Hosting : changing dynamic url into static url
- Bluehost : I can’t access my website after my files are uploaded
- Web Hosting : .htaccess issues - Redirect
- Bluehost : help with redirects?
- Bluehost : htaccess redirect question
- Web Hosting : Hotlink Protection doesn’t work in CPanel
This web hosting blog is proudly hosted with reliable Hostgator webhosting for only one cents through this hostgator coupon. If you're new here, you may want to subscribe to this web hosting RSS feed









Sorry, comments for this entry are closed at this time.