using regex for querystring escaping

CLOSED

using regex for querystring escaping

Postby mojito » Wed Mar 23, 2011 3:26 am

I am struggling with bots registering on my site. I want to redirect the problem url not protected with a capture to one that is.
I have been unable to do this using normal 301 redirect such as

redirect 301 /component/user/?task=register http://site.com/home/register

this needs doing with regex. I cant seem to escape the correct parts this is what im trying
Code: Select all
RewriteCond %{QUERY_STRING} ^task=register#content$
RewriteRule ^(.*)$ http://site.com/home/register [L,R=301]


the first line is saying look at the query string when it is similar to the following form
the second line is saying in the case that it is redirect to the given...but it doesn't work, I'm sure its the regex that is wrong.

Can I not simply do this ^task\=register$ should any url have this then i want to redirect... but alas it doesnt seem to work.
mojito
 
Posts: 9
Joined: Fri Mar 21, 2008 2:48 pm
Location: London

Return to New Threads/Problems

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron