Tricky mod_rewrite

Discussion in 'Apache' started by jontelofot, Aug 27, 2004.

  1. #1
    I currently have the following rule:
    RewriteRule ^Dir/(.*)$ index.php?cat=$1

    This rule changes for example:
    /index.php?cat=SEO
    to:
    /Dir/SEO/

    However, I want it as just:

    /SEO/

    Removing the 'Dir' part in the rule generates an error, and I can't seem to find an example anywhere. I'm sure it's pretty easy, but I just can't figure out the syntax...

    Help! :)

    /Jon
     
    jontelofot, Aug 27, 2004 IP
  2. jontelofot

    jontelofot Peon

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Nevermind. A trailing slash after the wildcard was all it needed! :)

    RewriteRule ^(.*)/$ ?cat=$1
     
    jontelofot, Aug 27, 2004 IP