Force WWW with htaccess

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • itx
    Confirmed User
    • Aug 2007
    • 980

    #1

    Force WWW with htaccess

    Hello,

    I am trying to force the www version of a website and I'm trying doing this with .htaccess but it simply doesn't work I don't know what Im doing wrong :S

    Currently using this code in .htaccess

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^(.*)\.domain\.com$ [NC]
    RewriteRule ^(.*)$ http://www.domain.com/ [R=301,L]
    </IfModule>
  • thebedshark
    Registered User
    • Jul 2009
    • 88

    #2
    This is what I use in my htaccess

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain.com [NC]
    RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
    Contact Info: ICQ: 561317340 Email: gfy (at) thebedshark.com - More Trades At TheBedShark
    babesbycity.com - bigtittedgirls.com - explicitamateur.com - freehustlersex.com - hustlersexvideo.com - amateurteenphotos.com

    Comment

    • itx
      Confirmed User
      • Aug 2007
      • 980

      #3
      Your code works in the .htaccess, Thanks

      Comment

      Working...