Welcome to MobyThreads.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Using mod ReWrite to redirect request with certain paramet..

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Related Topics:
rewrite rules (redirect all request to a single host) - sorry about this new i just noticed, that i messed up a running thread with the same subject. <font <font <font i redirect http traffic from..

URL rewrite help - redirect complete URI - I want to generate pages for my domain name for example, I want to redirect to to I want to

Help needed - Mod Rewrite/redirect for subdomains - Hi, I'm in need of some (read: please bail me out 'cos I'm really stuck!) My webhosts allow to be created so that for instance can be accessed through

mod rewrite - find word and redirect - How would I write a statement that will search the entire URL for a word or pattern and if found, redirect it? In other words if I wanted to search for the word 'monkey' anywhere in the url, whether as a parameter (like or..

redirect german traffic with mod rewrite - Hello, I am wondering how those big sites like google redirect specific internet traffic. Is it possible to create a rewrite rool the german, austrian and swiz ip adresses and shift this traffic a german site? The only thing I found is..
Next:  Apache: apache 2.0.x will not serv perl/cgi scripts -> (OS 6)The h..  
Author Message
Charles Crume

External


Since: Oct 07, 2005
Posts: 24



(Msg. 1) Posted: Tue Oct 23, 2007 5:16 pm
Post subject: Using mod ReWrite to redirect request with certain parameters.
Archived from groups: alt>apache>configuration (more info?)

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...

 >> Stay informed about: Using mod ReWrite to redirect request with certain paramet.. 
Back to top
Login to vote
Jim Hayter

External


Since: Feb 07, 2005
Posts: 81



(Msg. 2) Posted: Tue Oct 23, 2007 6:33 pm
Post subject: Re: Using mod ReWrite to redirect request with certain parameters. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Charles Crume wrote:
> 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.)

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>

 >> Stay informed about: Using mod ReWrite to redirect request with certain paramet.. 
Back to top
Login to vote
Charles Crume

External


Since: Oct 07, 2005
Posts: 24



(Msg. 3) Posted: Wed Oct 24, 2007 11:28 pm
Post subject: Re: Using mod ReWrite to redirect request with certain parameters. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Jim Hayter" <see.reply.to.DeleteThis@nowhere.invalid> wrote in message
news:13hstkiev3p6b41@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...
 >> Stay informed about: Using mod ReWrite to redirect request with certain paramet.. 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]