You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by DM <do...@yahoo.co.uk> on 2006/11/10 18:02:50 UTC

[users@httpd] using mod_rewrite to change param value

Hi,

I want to use mod_rewrite to change a URL such as the following:

http://www.example.org/myProgram?param1=val1&url=http://host.domain.com/foo/bar.html

to

http://www.example.org/myProgram?param1=val1&url=http://something.else.com/foo/bar.html


I've verified that mod_rewrite is correctly installed and enabled - it works for simple rewriting examples, but I can't seem to work out the correct "RewriteRule" syntax for changing the value of the url parameter as show above.


Thanks in Advance,
DM

Send instant messages to your online friends http://uk.messenger.yahoo.com 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] using mod_rewrite to change param value

Posted by Joshua Slive <jo...@slive.ca>.
On 11/10/06, DM <do...@yahoo.co.uk> wrote:
> Hi,
>
> I want to use mod_rewrite to change a URL such as the following:
>
> http://www.example.org/myProgram?param1=val1&url=http://host.domain.com/foo/bar.html
>
> to
>
> http://www.example.org/myProgram?param1=val1&url=http://something.else.com/foo/bar.html
>
>
> I've verified that mod_rewrite is correctly installed and enabled - it works for simple rewriting examples, but I can't seem to work out the correct "RewriteRule" syntax for changing the value of the url parameter as show above.

And what did you try?  Did you read the box in the RewriteRule docs
about the Query String?  It tells you that you need to use a
RewriteCond based on %{QUERY_STRING}.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org