question for mod rewrite experts...

Discussion in 'Apache' started by colombo, May 1, 2008.

  1. #1
    Hi,
    i need to do the following rewrite:

    mydomain.com/dir/var1.html?var2=x&var3=y

    to

    mydomain.com/test.php?var1=var1&var2=var2&var3=var3

    can you help me with this one...?

    thanks for your time
     
    colombo, May 1, 2008 IP
  2. Randombase

    Randombase Peon

    Messages:
    224
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    RewriteEngine on
    RewriteRule ^dir/(.*)\.html?var2=(.*)&var3=(.*)$ test.php?var1=$1&var2=$2&var3=$3
    Code (markup):
    Most likely wrong :)
     
    Randombase, May 1, 2008 IP
  3. colombo

    colombo Active Member

    Messages:
    136
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    85
    #3
    thanks for your replay Randombase

    RewriteEngine on
    RewriteRule ^dir/(.*)\.html?var2=(.*)&var3=(.*)$ test.php?var1=$1&var2=$2&var3=$3

    this is the basic rule, and its not working.

    the problem is with the "?" sign after the ".html" (RewriteRule ^dir/(.*)\.html?)

    i found some post about it here - http://www.webmasterworld.com/apache/3133879.htm

    but i don't know how to change it so it will work :(

    if any one understand what i need to do in order to fix it pls help.
     
    colombo, May 1, 2008 IP