301 redirects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,
I need to 301 rediect mysite.com to www.mysite.com. I found two examples on google search :
RewriteEngine on
RewriteCond %{http_host} ^mysite.com [nc]
RewriteRule ^(.*)$ http://www.mysite.com$1 [r=301,nc] and  

RewriteEngine on
RewriteCond %{http_host} ^mysite\.com$
RewriteRule ^.*$ http://www.mysite.com% {Request_URI} [R=permanent,L]
As you can see these two mod_rewrites are diferent, which one is correct? Or can I simply use the redirect directive like this:
RedirectPermanent /mysite.com http://www.mysite.com/
Thanks for any help you can give, I'm new to all this.
Stuart

More new features than ever. Check out the new AOL Mail!

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux