The Condition as written will work on any query that begins with "s=". You don't need capturing parentheses or a closing anchor; in fact you don't even need the .* if all that matters is s=
The Rule as written will take any request for the exact page
www.example.com/news/page.php/index\.php
(whoops! forgot to escape the first literal period) and redirect it to the home page after deleting the whole query string.
Is that what you intended? Can't help but suspect it isn't, what with those two separate "php" elements.
:: memo to self: write up boilerplate on what to say instead of "it's not working" ::
maxtter
8:08 am on Nov 14, 2011 (gmt 0)
All I need is to this url
http://www.example.com/news/page.php?s=page_name
redirect to the home page.
So all after www.example.com matters, not just s=
g1smd
12:35 pm on Nov 14, 2011 (gmt 0)
The
%{QUERY_STRING}
to match with the
RewriteCond
RegEx is
(^|&)s=page_name(&|$)
The path to match with the
RewriteRule
RegEx pattern is
^news/page\.php
The target URL is
http://www.example.com/
The
[R=301,L]
flags will make this a 301 redirect.
What's the problem?
maxtter
1:17 pm on Nov 14, 2011 (gmt 0)
It works :) No problem any more :) Thank you very much!