Forum Moderators: phranque

Message Too Old, No Replies

mod_rewrite on query string?

Need to find way to use mod_rewrite to rewrite querystring as well

         

fish

6:44 pm on Jan 31, 2005 (gmt 0)

10+ Year Member



Hi smarties -

I need to find a way to rewrite my QUERY_STRING along with my REQUEST_URI. The original URL will look like this:

[foo.com...]

and needs to be re-written to this:

[foo.com...]

I have successfully use mod_rewrite for the REQUEST_URI like so:

RewriteRule (.*)jhtml(.*) $1jsp$2 [R]

That part is working just fine, and I am able to get [foo.com...] So how can I similarly modify the QUERY_STRING? Note that there are a number of other parameters in the query (and I don't know for certain where the page param will appear) so I can't just strip off the query string and append .jsp on the end.

Any advice would be appreciated.

jdMorgan

9:47 pm on Jan 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



fish,

Welcome to WebmasterWorld!

See RewriteCond %{QUERY_STRING} in the Apache mod_rewrite documentation.

Jim