1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

301 redirect an entite folder to a specific URL

Discussion in 'Apache' started by gohotels, Jun 7, 2012.

  1. #1
    Hello, I am trying to 301 redirect a folder and a page to a new url.The new url = http://www.gohotels.com/city/buenos_aires_argentina.htmThe old url = http://www.gohotels.com/destinations/argentina/buenos_airesThe old folder = http://www.gohotels.com/destinations/argentina/buenos_aires/The code that I am using in htaccess is RewriteEngine OnRedirect 301 /destinations/argentina/buenos_aires http://www.gohotels.com/city/buenos_aires_argentina.htmRedirectMatch 301 /destinations/argentina/buenos_aires/(.*) http://www.gohotels.com/city/buenos_aires_argentina.htmThe page re-directs fine however the folder re-directs to the new url and then adds a forward slash (followed by whatever the user typed) to the end of the url causing a 404 error.I need all pages in the old folder to forward to the new url http://www.gohotels.com/city/buenos_aires_argentina.htm - so if somebody typed http://www.gohotels.com/destinations/argentina/buenos_aires/old-hotel-name-or-anything-else they would get re-directed to http://www.gohotels.com/city/buenos_aires_argentina.htmNOT http://www.gohotels.com/city/buenos_aires_argentina.htm/old-hotel-name-or-anything-elseEssentially I want to make the re-direction to the url absolute and not allow variables or additional characters to be added..Any help would be appreciated, Many Thanks!
    SEMrush
     
    gohotels, Jun 7, 2012 IP
    SEMrush
  2. SpiderxXx

    SpiderxXx Peon

    Messages:
    12
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Sorry but the post is not readable at all.
    Can you please format the text so it is read-friendly?
     
    SpiderxXx, Jun 9, 2012 IP