WEB .htaccess redirect w/ query string help

Discussion in 'OT Technology' started by fishbulb, May 23, 2009.

  1. fishbulb

    fishbulb Active Member

    Joined:
    Oct 29, 2001
    Messages:
    6,848
    Likes Received:
    4
    Location:
    md
    Last edited: May 23, 2009
  2. biawokauns

    biawokauns New Member

    Joined:
    Sep 18, 2001
    Messages:
    19,893
    Likes Received:
    0
    Location:
    Republic of Kalifornia
    you would do something like

    Code:
    RewriteEngine On 
    RewriteBase / 
    RewriteRule ^(.*)help/[0-9]+) $1PATH_TO_YOUR_FILE/FILE.php?id=$2
    
     
  3. fishbulb

    fishbulb Active Member

    Joined:
    Oct 29, 2001
    Messages:
    6,848
    Likes Received:
    4
    Location:
    md
    Thanks, but I think that's the opposite process of what I'm trying to do.. or the step after what I'm trying to do I should say.

    I want those who enter through a link that is the old style url to be forced into forwarding the new "cleaner" url. I know it can easily be done with PHP, but I was trying to see if there was a way to do it with .htaccess.

    This is an odd case where a lot of people are copying and pasting the url when the enter so I'd prefer it to forward to the new style URL if they enter on the old one.
     

Share This Page