MAVERICK
asked on
Apache mod_rewrite question - Round 2
Hi Everyone.
I have a URL like the following;
http://devserver.local/signuperror.htm?name=Maverick&msg=1
http://devserver.local/signuperror.htm?email=maverick%40devserver.local&msg=2
I need to rewrite it into the following form.
http://devserver.local/page.php?p=signuperror&name=Maverick&msg=1
http://devserver.local/page.php?p=signuperror&email=maverick%40devserver.local&msg=2
You can assume there will only ever be two terms on the input.
Cheers!
-John
I have a URL like the following;
http://devserver.local/signuperror.htm?name=Maverick&msg=1
http://devserver.local/signuperror.htm?email=maverick%40devserver.local&msg=2
I need to rewrite it into the following form.
http://devserver.local/page.php?p=signuperror&name=Maverick&msg=1
http://devserver.local/page.php?p=signuperror&email=maverick%40devserver.local&msg=2
You can assume there will only ever be two terms on the input.
Cheers!
-John
Maverick,
I am not an expert in mod_rewrite, but the "%1" looks strange... isn't it suppose to be $1 ?
I am not an expert in mod_rewrite, but the "%1" looks strange... isn't it suppose to be $1 ?
ASKER
Hi Samri,
Apparently not - $1 refers to terms in the URL not the query string.
Here is the 'round 1' question
https://www.experts-exchange.com/questions/21002207/Apache-mod-rewrite-question.html
Cheers!
-John
Apparently not - $1 refers to terms in the URL not the query string.
Here is the 'round 1' question
https://www.experts-exchange.com/questions/21002207/Apache-mod-rewrite-question.html
Cheers!
-John
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry about the delay
Will confirm ahoffmans' suggestion and get back to you ASAP
Maverick
Will confirm ahoffmans' suggestion and get back to you ASAP
Maverick
ASKER
I've been having unrelated issues on my development server & time contraints that prevented me from fully evaluating ahoffman's solution. I believe it was basically correct, there was just some further issues that prevented me from fully perfecting the rewrite rules required (& why i didn't originally accept the answer)
I decided to give ahoffam the points and close the question.
Maverick
I decided to give ahoffam the points and close the question.
Maverick
ASKER
I used the following rule which half works - i still can't pass the msg part of the query string.
RewriteCond %{QUERY_STRING} name=(.*)
RewriteRule ^signuperror.htm /page.php?p=signuperror&na
RewriteCond %{QUERY_STRING} email=(.*)
RewriteRule ^signuperror.htm /page.php?p=signuperror&em
Cheers!
Maverick