301 Redirect code help

Discussion in 'Apache' started by Muztik, Jul 19, 2006.

  1. #1
    I've only recently purchased a domain and hosting and I have access to Cpanel. I have enbaled 'Hotlink Protection' for my site.

    For seo purposes I would like to do 301 redirect for all non www pages to www version. I am trying to simply add in to HTaccess file:
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^mysite.org [NC] 
    RewriteRule ^(.*)$ http://www.mysite.org/$1 [L,R=301]
    Code (markup):
    but in doesn't work. The code on its own works, but not if Hotlink protection is enabled.

    Can somebody help me out here?

    Thanks
     
    Muztik, Jul 19, 2006 IP