Forum Moderators: phranque

Message Too Old, No Replies

Blocking Links From Other Sites - Rewrite?

         

decdim

11:33 pm on Jan 14, 2004 (gmt 0)



Okay here's the problem, some sites have old links to my site and I have attempted to contact them to update their links (remove or change). Some sites have been considerate - even editing/deleting personal pages where the user failed to respond to my request (no response or no longer available). Unfortunate some sites still haven't updated (3 companies) and I'm tired of 404 errors showing up.

What I'm doing for the moment is creating permanent redirects of the pages they are looking for which no longer exist. However I'm aware that it could be possible to redirect the "offending sites" who link up with bad links or block their links to not work. I would prefer this so I could keep track of new sites who have bad links and contact them about it.

Any suggestions or links to how to do this (block the sites I don't want linking in but allowing others sites to show up so I can contact them)?

Thanks in advance!
---
Update:
I think I found what I'm looking for here:

[webmasterworld.com...]

but I need another example besides the one shown (perhaps with several "fake sites") so I get a clearer picture on blocking. Currently I've got 3 sites that contain bad links that haven't updated the links after several requests...

keyplyr

7:15 am on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It's best to use IPs, but domains also work like this:

RewriteEngine On
RewriteCond %{HTTP_REFERER} site1\.com [OR]
RewriteCond %{HTTP_REFERER} site2\.org [OR]
RewriteCond %{HTTP_REFERER} site3\.net
RewriteRule - [F]

This gives a 403 Forbidden to anyone following links to your site from those 3 sites. Using this method, you shouldn't see these failures in your error_log.

decdim

4:05 pm on Jan 15, 2004 (gmt 0)



Thanks keyplyr!

Off hand, if I wanted to reroute those sites to a bad link/site (doesn't exist) - would I use something like:

RewriteRule [update.your.links...] - [F]

as the "Rule" to send all attempts from that site away (so it doesn't effect bandwidth)? Already pages that doesn't exist due to bad links are routed to 404 but it hasn't been effective with some sites - so I figured by sending it to a nonexistant site then eventually they will get the picture that the link doesn't work and update it finally.

keyplyr

6:25 pm on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You would need to exempt that one page with the exclamation-mark (!), then use the starting (^) and ending ($) anchors:

RewriteRule !^update\.your\.links$ - [F]

so I figured by sending it to a nonexistant site then eventually they will get the picture that the link doesn't work and update it finally.

<added>
I think you are directing your efforts to the wrong person, since it is most likely that average users will be following these links and not the owner of the website. You will only be loosing visitors. Why not just create a small, text-only page 404 page with the correct link to your site?

(edited to allow page from within domain)

[edited by: keyplyr at 6:42 pm (utc) on Jan. 15, 2004]

decdim

6:27 pm on Jan 15, 2004 (gmt 0)



Thanks again, it helps to clarify what exactly to "Rule" so that it works (fails for the site who doesn't update their links).

This will help me clean up my .htaccess file from endless Redirect permanent and identify new sites with old links to contact and hopefully block the sites who fail to update for a while (or indefinately)!

Regards!

---
Add-on:
Most of the "dead links" that exist on these other sites are outdated; that is, they refer to things on my site that no longer exist. Also the links that are outdated refer to old information.

Quick break-down...
...had a retail business, with internet site for 6 years. Last year we closed and became reps for other companies. So the format of the website changed from retail to informative; the entire website changed and most of the site was deleted. The good search engines have updated their links (bots/spiders) with the new pages but there are a few that haven't. Those I've contacted about updating/deleting the links and they haven't responded - even 3 months later they still don't respond. Most of the pages were changed/deleted 4-5 months ago! They keep directing people to our site for things we don't carry or deal with. Others have a link to "homepage.htm" (my original index.html page) which was deleted 4 years ago but they haven't updated that either! I've been trying to be patient with sites on updating but some are worthless and need to be blocked (along with their visitors). It gets tiring seeing people attempting to visit a dead page not once but usually 3-4 times (as though if they click on it enough times it will show up or something, instead or reading the 404 page that comes up stating the page no longer exists). I'm even using a 404.php page that informs the user to please contact the referring site to update their links (and sends me an e-mail telling me what page was attempted to be viewed and where the request came from - search engine, personal page, etc., so I can contact that site about the bad link). So in short I'm going to block the sites that refuse to update and stop the bandwidth along with it. >:-D

decdim

7:52 pm on Jan 15, 2004 (gmt 0)



Need to add-on/edit the RewriteCond:

RewriteCond %{HTTP_REFERER} site1\.com [OR]
<snip>
RewriteRule!^http://update\.your\.links$ - [F]

One site showing definate blocking, but another isn't and generating (or attempting to) 403 Error but won't show the page.

The RewriteCond works for anywhere and any directory on the referring site? Or do I need to put it like this to allow that:

RewriteCond %{HTTP_REFERER} site1\.com\.* [OR]

Do I need any extra "switches" or? to allow for sites that use directories (/sub1/sub2/etc.)?