Re: How to strip out the query parameter for specific URLs using mod_rewrite?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4 Oct 2012, at 16:52, Ben Johnson wrote:

> 
> 
> On 10/4/2012 11:32 AM, Bhattacharya, Sudip wrote:
>> Hi Sridhar,
>> 
>> This would apply to the whole virtual host. I need to enable it for specific subfolders.
> 
> Something like this should work:
> 
> RewriteCond %{REQUEST_URI} =/folder/xmlfiles/static.xml
> RewriteCond %{QUERY_STRING} !=""
> #The ? at the end causes the %{QUERY_STRING} to be omitted
> #from %{REQUEST_URI} during rewriting.
> RewriteRule ^(.*)$ %{REQUEST_URI}? [R=301,L]
> 
> If any mod_rewrite expert has suggestions or revisions, please jump in.

OTTOMH I doubt that would work.  The rewrite would come too late to
stop mod_cache seeing and acting on the query string.  But I could
be wrong.

The ideal solution would be to strip off those query strings before they
ever reach the browser (which also helps the browser itself to cache things).
Are they generated as links or as HTTP redirects?  If links then a
ProxyHTMLURLMap (if the performance hit of parsing HTML is acceptable);
if HTTP headers then a ProxyPassReverse variant would seem a startingpoint.

-- 
Nick Kew
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux