Site moved from from a.com/sub to b.com need help redirecting.

Discussion in 'Apache' started by slickk, Apr 6, 2007.

  1. #1
    Hi.

    I recently moved an SMF forum from a sub-folder of one domain to its own domain.

    xxx.com/subfolder ----------> yyy.com

    How can I use htaccess to redirect all urls to the new domain so that it goes to the new page.

    For example let's say I had xxx.com/subfolder/index.php?topic=399.msg3382

    I would want that redirecting to yyy.com/index.php?topic=399.msg3382

    Thanks a lot.
     
    slickk, Apr 6, 2007 IP
  2. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #2
    following should work
    in .htaccess of old domain add the line

    redirect 301 /subfolder_to_previous_forum_on_old-domain http: // www. new domain .com/

    all one line - remove spaces in URL of new domain above !

    this should do exactly what you intend
    note

    old subfolder - starts with /subfolder - NO full URL
    then space
    then
    new location = FULL URL starting http
     
    hans, Apr 6, 2007 IP
  3. slickk

    slickk Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks a lot.
    It worked.:D
     
    slickk, Apr 6, 2007 IP