Concerning 301 redirect..

Discussion in 'Search Engine Optimization' started by x3sphere, Oct 16, 2006.

  1. #1
    Was reading some stuff on 301 redirects, so I made a script that gets rid of the www from subdomain, and redirects anyone going to mydomain/forums, to the subdomain forums.mydomain.com.

    Options All -Indexes
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www\.)?exophase\.com [NC]
    RewriteCond %{THE_REQUEST} ^[A-Z]+\ /forums/
    RewriteRule ^forums/(.*) http://forums.exophase.com/$1 [R=301,L]
    Code (markup):
    and then the .htaccess in subdomain directory (this is on a cpanel account)
    Options All -Indexes
    Redirect 301 /forums/ http://forums.exophase.com/
    Code (markup):
    If there are any problems with this or how I can make it better let me know.
     
    x3sphere, Oct 16, 2006 IP
  2. trueman

    trueman Well-Known Member

    Messages:
    554
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    it's looks good to me :)
     
    trueman, Oct 23, 2006 IP
  3. justtupeu

    justtupeu Peon

    Messages:
    79
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yep, works fine. I'm using something similar for my board.
     
    justtupeu, Oct 23, 2006 IP