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

need help with htaccess file

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

  1. extra

    extra Jr. VIP Jr. VIP Premium Member

    Joined:
    May 18, 2007
    Messages:
    533
    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:
    239
    Likes Received:
    74
    Try
    Code:
    RewriteCond %{HTTP_HOST} ^domain.com
    RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
    :)