I'm trying to foil bots from registering on my site. The issue is a form that is on a url without a capture. I have a different form with a capture I want to redirect to
I want
http://site.com?task=register#content
to redirect to
http://site.com/home/register
Here is what I have so far
redirect 301 ^task\=register\#content$ http://site.com/home/register
NOTE : The solution needs开发者_JS百科 to have regex involved because the query string is complex with its characters that need escaping which the slash should be doing.
Thank you.
I would try doing it like this:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule ^(.*)$ http://www.other.com/$1 [R=permanent,L]
Remove the caret (^), i.e.
redirect 301 task\=register\#content$ http://site.com/home/register
精彩评论