HELP: URL re-writing

Discussion in 'Site & Server Administration' started by Mr.Dog, Nov 10, 2012.

  1. #1
    Hi,

    I am struggling with reqriting my URLs like this:

    from:
    http://www.mysite.com/travel/new-york.htm

    to:
    http://www.mysite.com/travel/new-york/

    I had something like this running in the htaccess, but I had to take it out, because it was working in some cases, but in others not.

    The problem was that it was redirecting to a folder called "new-york"... I might have a page called new-york.htm, but I might also have a folder/new-york/index.htm

    And the script was redirecting from:
    http://www.mysite.com/travel/new-york.htm
    (New York city)

    to:
    http://www.mysite.com/travel/new-york/
    (the State of New York)

    And this way the visitor didn't get to a rewritten URL "New York city" page (new-york.htm), but was redirected to:
    http://www.mysite.com/travel/new-york/index.htm
    (which was the State of New York)

    So normally the rewriting issue worked with lots of other pages...
    But if the rewriting software modifies the page.htm to page/ and there also exists a "page" folder, then it will literally redirect to that folder instead of just rewriting the way the URL looks...

    I hope I was clear enough...

    So I need a script that replaces the ".htm" with the "/", but doesn't redirect!

    Million thanks to anyone who can help!
     
    Mr.Dog, Nov 10, 2012 IP
  2. cesurasean

    cesurasean Active Member

    Messages:
    269
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #2
    Try asking in #httpd on irc.freenode.net !!!
     
    cesurasean, Feb 23, 2013 IP