[HELP] What is the rewrite rules for domain.com/forums to www.domain.com/forums?

Discussion in 'Apache' started by ahheng, Jun 16, 2010.

  1. #1
    Hi guys, I need help. i installed wordpress on my main domain which is sgpspclub.com, and i have moved my forum to "sgpspclub.com/forums". can someone give me the rewrite codes for directing non-www -->> domain.com/forums to www.domain.com/forums?

    Example, when people type domain.com/forums it will direct them to www.domain.com/forums.
     
    ahheng, Jun 16, 2010 IP
  2. ahheng

    ahheng Active Member

    Messages:
    118
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    83
    #2
    Can someone pls help me with this?
     
    ahheng, Jun 16, 2010 IP
  3. bvsonline

    bvsonline Peon

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^yourdomain.com
    RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
     
    bvsonline, Jun 18, 2010 IP
  4. ahheng

    ahheng Active Member

    Messages:
    118
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    83
    #4
    ahheng, Jul 3, 2010 IP
  5. ahheng

    ahheng Active Member

    Messages:
    118
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    83
    #5
    My main root htaccess is using the codes:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    my public_html/forums is using the below codes:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^yourdomain.com
    RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
     
    ahheng, Jul 3, 2010 IP
  6. seodetectors07

    seodetectors07 Notable Member

    Messages:
    941
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    205
    #6
    Also change your .httaccess permission 777.
     
    seodetectors07, Jul 6, 2010 IP