apache rewrite rule with parameters -


i have following url:

http://www.domain.com/results.php?state=wa&city=seattle&sub=algebra 

i appear as:

http://www.domain.com/results/wa/seattle/algebra 

and...

http://www.domain.com/results.php?state=wa&city=seattle 

as

http://www.domain.com/results/wa/seattle 

i figure write first as:

rewriterule ^results/(.*)/(.*)/(.*)$  /results.php?state=$1&city=$2&sub=$3 [l] 

but i'm stuck figuring out how combine both of them... slashes throwing me. suggestions?

rewriterule ^results/([^/]+)/([^/]+)/([^/]+)$  /results.php?state=$1&city=$2&sub=$3 [l] rewriterule ^results/([^/]+)/([^/]+)$ /results.php?state=$1&city=$2 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -