301 from subfolder to main domain?

Discussion in 'Apache' started by Barry Scott, Jul 10, 2008.

  1. #1
    Hi

    I recently moved a forum from domain.com/forum to domain.com

    I have found ways to 301 redirect the traffic but all of them hang onto the request in full, but just remove, /forum/.

    What i need to do is redirect domain.com/forum/index.php?search=newposts or domain.com/forum/profiles.php?edit etc., so everything requesting info from domain/forum, regardless of the request is redirected to domain.com/index.php

    Does that make sense? Any request to domain.com/forum, regardless of the request gets redirected to domain.com without the full address requested being carried over.

    Thanks

    :D
     
    Barry Scott, Jul 10, 2008 IP
  2. wattie

    wattie Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Please the following .htaccess in the subfolder that you want to redirect everything:

    
    redirect 301 / http://www.yourdomain.com/
    
    Code (markup):
     
    wattie, Jul 16, 2008 IP
  3. z0haib

    z0haib Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I need help with this same problem... I want to redirect visitors from old url (subfolder) to new url (main folder).

    old url is like:
    hxxp://www.yoursite.com/site/anything-blog-title/

    i want to redirect it to:
    hxxp://www.yoursite.com/anything-blog-title/

    The solution given above.. doesn't redirect to the post which visitor was trying to visit. It just redirects to the homepage..
     
    z0haib, Jul 20, 2008 IP