Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to access GET parameters from mod_rewrite.

E.g., given this URL: http://myserver.com/foo.png?foo=bar

The following rule does not catch this URL:

RewriteCond %{REQUEST_URI} bar [NC]

While this one does:

RewriteCond %{THE_REQUEST} bar [NC]

Doesn't REQUEST_URI include GET parameters? Is THE_REQUEST the way to go?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Yes, THE_REQUEST is the way to go as it will contain the entire http request with the following stipulation:

THE_REQUEST
The full HTTP request line sent by the browser to the server (e.g., "GET /index.html HTTP/1.1"). This does not include any additional headers sent by the browser.
share|improve this answer
    
I looked at the documentation, but I interpreted it to mean REQUEST_URI would contain the GET parameters. Oh well. –  ripper234 Nov 6 '11 at 15:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.