PDA

View Full Version : Prevent access from a certain URL?


maipoman
12-03-2007, 03:07 PM
Hey! :)

I was wondering if there is a mod that prevents users from accessing the vBulletin forum from a certain domain?
I don't want them to click on that URL and enter my board. I would like to give them a error message or simply re-direct them elsewhere.
I've tried to search for something like this, but couldn't find anything. Does anyone know if it's possible to do this?

Awjvail
12-03-2007, 03:13 PM
in .htaccess put the following:

RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} badsite\.com [NC]
RewriteRule .* - [F]

replace badsite with the site you want to block.

multiple domains:

RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} badsite\.com [NC,OR]
RewriteCond %{HTTP_REFERER} anotherbadsite\.com
RewriteRule .* - [F]

Note the backslash before the domain.

If you don't have a .htaccess, you should create one and place it in your vB directory.

maipoman
12-03-2007, 03:41 PM
Thank you! That worked like a charm! :)

I used to have a .htaccess file in my root folder before, to prevent abuse from some people who used Tor to get on anonymously, but that .htaccess file slowed down the server so much that I had to delete it. This didn't slow it down at all! So thanks again!

maipoman
12-06-2007, 09:35 PM
Just one more question... Is there a way to redirect the traffic to a different site, instead of just giving them the "You're not authorized to view this site"-page?