homepage Welcome to WebmasterWorld Guest from 54.235.227.60
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Search a word in query string
htaccess help
tabish




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

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

 

lucy24




msg:4337990
 3:57 pm on Jul 11, 2011 (gmt 0)

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved