Jump to content


.htaccess redirect?


2 replies to this topic

#1 Woe

    Young Padawan

  • Validating
  • Pip
  • 17 posts

Posted 30 June 2006 - 05:50 PM

Unfortunately, I've come across a lot of idiotic people who think it is fun to spam. So I've used .htaccess to block their IP's and hosts. But there is a certain guy who is a forum spammer so I thought it'd be funny to redirect him to google.com when he types in the URL to my site's forum. So how would I go about redirecting him to google.com with .htaccess?

#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 01 July 2006 - 01:20 AM

RewriteCond %{REMOTE_ADDR} 000.000.000.000
RewriteRule .* http://google.com[F,L]
That would be my best guess. I use something similar in my .htaccess to prevent e-mail harvesting bots. Although, as i've never really tested it, i can't say how well it would work.
You can also stack conditions.
i.e.
RewriteCond %{REMOTE_ADDR} 000.000.000.000
RewriteCond %{REMOTE_ADDR} 000.000.000.001
RewriteRule .* http://google.com[F,L]


#3 Woe

    Young Padawan

  • Validating
  • Pip
  • 17 posts

Posted 04 July 2006 - 01:24 AM

Thanks. I'll give it a try.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users