1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

.HTACCESS Help

Discussion in 'Web Hosting' started by hawke, Apr 13, 2010.

  1. hawke

    hawke Power Member

    Joined:
    Nov 14, 2008
    Messages:
    644
    Likes Received:
    533
    Location:
    Ohio
    I get a 500 internal error when I use this in my htaccess file in the root of the publichtml or the root of the subdomain...

    Code:
    Options +FollowSymlinks RewriteEngine on 
    rewritecond %{http_host} ^domain.com [NC] rewriterule ^(.*)$ http://www.domain.com/$1 [R=301,NC]
    
    I've tried replacing both domain urls with the addon domain address... but still the same...

    Can anyone help me sort this? thanks.
     
  2. MuonTrail

    MuonTrail Registered Member

    Joined:
    Mar 5, 2009
    Messages:
    96
    Likes Received:
    93
    Try this... this is how I enforce the www:

    Code:
    RewriteEngine on 
    
    RewriteCond %{HTTP_HOST} !^www\.domain\.com
    RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
     
    • Thanks Thanks x 1