need help with htaccess file

Discussion in 'Other Languages' started by extra, Feb 16, 2013.

  1. extra

    extra Power Member

    Joined:
    May 18, 2007
    Messages:
    534
    Likes Received:
    34
    Hello
    Can someebody help me with htaccess file
    i want to create file that redirect domain.com to www.domain.com
    but if i have this link www.domain.com/subdirectory change it to domain.com/subdirectory or if i can remove it from the rule

    Thanks
     
  2. Stufferizer

    Stufferizer Regular Member

    Joined:
    Nov 6, 2012
    Messages:
    283
    Likes Received:
    92
    Try
    Code:
    RewriteCond %{HTTP_HOST} ^domain.com
    RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
    :)