Welcome to WebmasterWorld Guest from 184.73.126.70

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Search a word in query string

htaccess help

   
10:13 am on Jul 11, 2011 (gmt 0)

5+ Year Member



Hi all,

I have been trying to fine "+" sign in my query string. for example if someone types example.com/test+love then it needs to be redirected to testcond.php

So I wanted to check if query string has plus sign in it or not? if no plus sign then it will not run that file.

i tried

RewriteCond %{QUERY_STRING} ^([+])$
RewriteRule ^([a-zA-Z\+]+)$ testcond.php?keyword=$1 [L]

but it didnt work. I just need to check if plus sign "+" is there in query, if plus sign is there only then testcond.php file should run.

Please help me.
Regards
3:57 pm on Jul 11, 2011 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



RewriteCond %{QUERY_STRING} ^([+])$
...
but it didnt work.

No, I don't suppose you will get many query strings that consist entirely of a single plus sign. What you have is equivalent to
^\+$
(beginning anchor, one character, ending anchor). Neither that capturing ( ) nor the grouping [ ] is relevant.