[Q] Domains | http://SITE.com | http://www.SITE.com

Siek

Regular Member
Joined
Feb 4, 2008
Messages
452
Reaction score
301
Hey guys,

I need some help on this one. I could probably search it up on google and find my answer really fast, but I'm not sure what keywords to use to even look up something like this...

So bascially I want

http://SITE.com

to be redirected as automatically

http://www.SITE.com

---------
Any help appreciated..

Thanks
 
Could do it with either htaccess or a 301 redirect. they should have approximately the same effect.

here's a couple links i found on google in about 4 seconds

Code:
http://fplanque.com/dev/http-ssl/www-domain-canonical-urls-mod_rewrite
http://www.stepforth.com/faq/non-www-redirect.htm
 
Redirect to www (htaccess redirect)

Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

Please REPLACE domain.com and www.newdomain.com with your actual domain name.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

Taken from
Code:
http://www.webconfs.com
 
301 redirect using .htaccess (does not work if you're on a windows server)
upload .htaccess files in ascii mode, sending it up as binary will break it

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]
 
damn that was quick guys... Good stuff - exactly what i needed =)
 
Back
Top