Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using mod ReWrite to redirect request with certain parameters.

1 view
Skip to first unread message

Charles Crume

unread,
Oct 23, 2007, 5:16:21 PM10/23/07
to
Hello;

I want to capture, and redirect, URLs that contain certain parameters (after
the ?). I have been reading a number of articles (web pages) on mod Rewrite,
but can't seem to get it working like I want.

For example, I want to redirect all URLs with "wxyz" in them, such as:

a.html?p1=123,p2=qwerty,wxyz=4
b.html?wxyz=def

Is what I want to do possible?

If so, can someone point me to an article (web page) or two that I can read?
(the pages I've found so far have not provided me the info I need.)

TIA.

Charles...


Jim Hayter

unread,
Oct 23, 2007, 6:33:45 PM10/23/07
to

This can be done using mod_rewrite. The parameters after the ? are
known as the Query_string. Rewrite Rules can be written that are
conditional on query_string matching a regular expression:

RewriteCond %{QUERY_STRING} wxyz
RewriteRule (.*) <redirect URL>

Charles Crume

unread,
Oct 24, 2007, 11:28:18 PM10/24/07
to

"Jim Hayter" <see.re...@nowhere.invalid> wrote in message
news:13hstki...@news.supernews.com...

[snip]

>
> This can be done using mod_rewrite. The parameters after the ? are known
> as the Query_string. Rewrite Rules can be written that are conditional on
> query_string matching a regular expression:
>
> RewriteCond %{QUERY_STRING} wxyz
> RewriteRule (.*) <redirect URL>

Thanks Jim;

I went back and scanned all my articles -- and there in one of them is the
mention of using {QUERY_STRING}. Looks like I missed it while trying to
absorb all the other info.

Thanks again.

Charles...


0 new messages