unlimitedphoenix23
New Member
- Messages
- 11
- Reaction score
- 0
- Points
- 0
I recently made someone a bit too angry during a rant and on a blogging website (Tumblr) and now they've been spamming my site. So my idea is to simply filter their IP address.
Since I have no access to the .htaccess there, I set up an A record so it'll link back to mine as blog. for the subdomain, but still, I don't know what to do from there.
Under /blog2/index.php (for testing purposes), I can use this for the IP filter.
That works fine, however the blog is located on blog. and using any redirect script I've tried so far (meta tags, javascript, or this [whatever this is] <!--#if*expr="${REMOTE_ADDR}*=*/^xxx.xxx.xxx.xxx/"*-->) hasn't worked for me at all. Unless there's some other way to have this redirect, I don't see much that I can do.
I may be doing .htaccess incorrectly but as far as I'm aware, it should look like this:
And as far as I know, blocking users with .htaccess should look like
I'm stumped, and I've looked everywhere I could go for this.
---------- Post added at 02:55 PM ---------- Previous post was at 01:20 PM ----------
Never mind everyone.
I found an easy way to do this.
Create a second Tumblr blog, and rename it to the main blog. Add a meta redirect to link to the php ip filter, which checks the blacklisted ips and then if it's not on the list, redirects to the main blog (which is renamed to the 2nd).
Works now :]
Since I have no access to the .htaccess there, I set up an A record so it'll link back to mine as blog. for the subdomain, but still, I don't know what to do from there.
Under /blog2/index.php (for testing purposes), I can use this for the IP filter.
PHP:
<?php
// The blacklisted ips.
$denied_ips = array(
'xxx.xxx.xxx.xxx'
);
function getUserIP()
{
if (!empty($_SERVER['HTTP_CLIENT_IP']))
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
return $ip;
}
$visitorIp = getUserIP();
$status = array_search($visitorIp, $denied_ips);
if($status !== false)
{
header("Location: http://tumblr.com");
exit;
}
?>
That works fine, however the blog is located on blog. and using any redirect script I've tried so far (meta tags, javascript, or this [whatever this is] <!--#if*expr="${REMOTE_ADDR}*=*/^xxx.xxx.xxx.xxx/"*-->) hasn't worked for me at all. Unless there's some other way to have this redirect, I don't see much that I can do.
I may be doing .htaccess incorrectly but as far as I'm aware, it should look like this:
however, I'm not sure if I can replace /old/old.htm with the blog's address, and the new page with the one that I want to redirect to.redirect 301 /old/old.htm http://www.you.com/new.htm
And as far as I know, blocking users with .htaccess should look like
Code:
order allow,deny
deny from xxx.xxx.xxx.xxx
allow from all
I'm stumped, and I've looked everywhere I could go for this.
---------- Post added at 02:55 PM ---------- Previous post was at 01:20 PM ----------
Never mind everyone.
I found an easy way to do this.
Create a second Tumblr blog, and rename it to the main blog. Add a meta redirect to link to the php ip filter, which checks the blacklisted ips and then if it's not on the list, redirects to the main blog (which is renamed to the 2nd).
Works now :]