httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Johnson <...@indietorrent.org>
Subject Re: [users@httpd] How to strip out the query parameter for specific URLs using mod_rewrite?
Date Thu, 04 Oct 2012 17:57:17 GMT


On 10/4/2012 12:01 PM, Bhattacharya, Sudip wrote:
> Great. This one worked.
> 
> However, it looks like the first request with the query string returns a 301 moved permanently
response, requiring another request from the browser to the file without the query string.
> 
> Can this redirection be avoided, so that the server returns the cached file on the original
response only?

Just change the last line to the following (to use Pass-Through, instead
of Redirecting with a specific status code):

RewriteRule ^(.*)$ %{REQUEST_URI}? [PT,L]

P.S. I can't speak to Nick Kew's comments (I don't use mod_cache), so
you'll just have to test this and see if it works for your purposes.

Good luck,

-Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message