Forum Moderators: phranque

Message Too Old, No Replies

Apache Redirect Question Mark HTTP Query?

         

JAB Creations

7:42 pm on Nov 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I used to handle folks connected via dial-up connections by directing them to a /du/ equivalent directory though now I want to setup a redirect match using an HTTP query. I read someplace that question marks aren't part of URLs (in Apache or?)...how do I set the following redirect. Right now it redirects to...
http://www.example.com/%5c%3f%5cconnection=0

- John

RedirectMatch \/*\/du\/ http://www.example.com/\?\connection=0

phranque

7:48 pm on Nov 30, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



you can look at the query string in a rewritecond, group the relevant part(s) and backreference it(/them) with %1(, %2, ...) syntax.
i know this works with rewriterule so i am assuming it also works with redirectmatch, although you should check the apache doc...

JAB Creations

8:06 pm on Nov 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm completely confused. What does %1 translate in to?

- John

phranque

8:32 pm on Nov 30, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



see if this helps:
[webmasterworld.com...]

JAB Creations

1:21 am on Dec 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I read the whole thread, most of the pages linked in the thread, and nothing has been broken down to essential parts; so I'm left without knowing what I need to use to construct the argument. Isn't there just a simple key table of some sorts available for Apache commands?

- John

jdMorgan

2:27 am on Dec 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Basic required reading:

Rewrite rules:
RewriteRule [httpd.apache.org]

Conditional execution of Rewrite rules:
RewriteCond [httpd.apache.org]

Set-up to use Rewrite Rules:
RewriteEngine [httpd.apache.org]

For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim