Re: Rewrite query string?

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

 





On Thu, Jan 4, 2024 at 5:03 PM Will Fatherley <wefatherley@xxxxxxxxx> wrote:

https://example.com/search?searchword=CVE-2021-4014&Search=

I've tried the following RewriteCond/RewriteRule in various forms, but not sure what I'm doing wrong.

RewriteCond %{QUERY_STRING} ^searchword=(.*)
RewriteRule ^   q=$1 [NC,L]

Ideas for what I'm doing wrong would be greatly appreciated.
Is the query parameter case sensitive? That’d be important for RewriteCond to know. Also, isn’t that the “starts with” operator, ^? What if the parameter comes second? A bit verbose, but:

 ^.*searchword=(\w{1})[&]{0,1}.*$

You don't want to use ^.* - just use the substring match behaviour by removing ^.* if you want to match searchword anywhere in the value. 

[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