
08-21-2002, 12:03 AM
|
|
Junior Guru Wannabe
|
|
Join Date: Apr 2002
Location: San Francisco
Posts: 95
|
|
Looking for a way to BLOCK a web page when it comes from a particular location
There's someone out there who has a web page of mine on their public profile. I don't want to be associated with this individual.
Using a service like Sitemeter it's possible to track where your hits are coming from.
Is it possible that to not only detect where a hit is coming from, but somehow block, or redirect (perhaps to another page that states "go away") when it comes from a specific location?
For example, if somone puts a link to my page on their profile at:
http://profiles.yahoo.com/(yahoo_ID_here)
Is it possible to reject or redirect the page by sensing where it comes from.
If previous page = x
then redirect to y
else, go to z
Is it possible to foward the page to another location if and only if it comes from a specific location or site?
|

08-21-2002, 12:09 AM
|
|
Community Guide
|
|
Join Date: Jun 2000
Location: Washington, USA
Posts: 5,976
|
|
Yes, you can do this. By using a script. Or perhaps Apache mod_rewrite could do this.
__________________
John T. Yocum -- Fluid Hosting
Shared - VPS - Dedicated - Colocation
|

08-21-2002, 12:13 AM
|
|
Junior Guru Wannabe
|
|
Join Date: Apr 2002
Location: San Francisco
Posts: 95
|
|
Quote:
Originally posted by JTY
Yes, you can do this. By using a script. Or perhaps Apache mod_rewrite could do this.
|
Could you please explain how I can do this? Where is this script/code? I'm very good with HTML, but I don't know what Apache mod_rewrite is.
Thanks.
|

08-21-2002, 12:17 AM
|
|
Web Hosting Guru
|
|
Join Date: May 2002
Posts: 323
|
|
I can't go into the details, but someone else will probably be able to...
Wouldn't it be easier and faster, since he knows where the traffic is coming from, to use a .htaccess file and the HTTP_REFERER var?
__________________
- prime [admin@exclaimhosting.com]
ExclaimHosting - Your voice on the web.
Fast, reliable hosting, at prices you can afford.
http://www.exclaimhosting.com
|

08-21-2002, 12:21 AM
|
|
Junior Guru Wannabe
|
|
Join Date: Apr 2002
Location: San Francisco
Posts: 95
|
|
Quote:
Originally posted by prime
Wouldn't it be easier and faster, since he knows where the traffic is coming from, to use a .htaccess file and the HTTP_REFERER var?
|
You're speaking in greek to me.
Is it possible to explain this in layman terms?
|

08-21-2002, 12:55 AM
|
|
Web Hosting Master
|
|
Join Date: Aug 2002
Location: Baltimore, Maryland
Posts: 580
|
|
php, perl, asp, jsp, c, .htaccess, firewall, i dunno 403 their asses
|

08-21-2002, 12:56 AM
|
|
Junior Guru Wannabe
|
|
Join Date: Apr 2002
Location: San Francisco
Posts: 95
|
|
Would someone please tell me how to do this?
|

08-21-2002, 01:55 AM
|
|
Junior Guru Wannabe
|
|
Join Date: Apr 2002
Location: San Francisco
Posts: 95
|
|
I posted this on several forums. Here, Emaildiscussions.com, Sitepoint...
and the winner is.....
CRAIGSLIST!!!!
http://forums.craigslist.org/?ID=2275667
Someone on Craigslist did this for me 
|

08-21-2002, 02:02 AM
|
|
learning is in the doing
|
|
Join Date: Sep 2000
Location: Alberta, Canada
Posts: 3,109
|
|
Have a look at this thread:
http://www.webhostingtalk.com/showth...threadid=47529
if applicable, just post your questions there -- helps to keep it together.
The above method uses .htaccess (tops in my book) but there a way to restrict access by using a JS script, that follows your method:
If previous page = x
then redirect to y
else, go to z
but, being JS, would require the code to be on every page -- not good. Using .htaccess you can apply restricting to every page on your Web site, with only a few lines of code in an .htaccess file.
__________________
• PotentProducts.com - for all your Hosting needs
• Helping people Host, Create and Maintain their Web Site
• ServerAdmin Services also available
|

08-21-2002, 02:21 AM
|
|
Junior Guru Wannabe
|
|
Join Date: Apr 2002
Location: San Francisco
Posts: 95
|
|
Thanks, it appears the Craigslist method:
http://forums.craigslist.org/?ID=2275667
is working just fine for my needs. 
|

08-21-2002, 03:54 AM
|
|
Junior Guru
|
|
Join Date: Aug 2002
Location: Plymouth
Posts: 212
|
|
anybody have any examples of this modrewrite?
I know some guy hotlinking my images.. leaeching of my bandwdith damnit.
|

08-21-2002, 04:11 AM
|
|
Junior Guru Wannabe
|
|
Join Date: Apr 2002
Location: San Francisco
Posts: 95
|
|
Quote:
Originally posted by combs
anybody have any examples of this modrewrite?
I know some guy hotlinking my images.. leaeching of my bandwdith damnit.
|
That's tricky. You can't put code into a .jpg file
|

08-21-2002, 04:25 AM
|
|
learning is in the doing
|
|
Join Date: Sep 2000
Location: Alberta, Canada
Posts: 3,109
|
|
Weelll, if your hoster provides Cpanel (like some do  ) then you have Anti-leech built in. If not, you can go the route of downloading a free/pay-for script (lots around at the script sites; look under: anti-leech) or using the .htaccess method with a RewritCond directive.
If you are not familiar with Apache directives, you are best to get in touch with your Hoster to see if/how they have Rewrite rules working.
__________________
• PotentProducts.com - for all your Hosting needs
• Helping people Host, Create and Maintain their Web Site
• ServerAdmin Services also available
|

08-21-2002, 05:35 AM
|
|
Web Hosting Guru
|
|
Join Date: Jul 2002
Location: Kolding, Denmark
Posts: 292
|
|
Put this in a .htaccess-file and the bugger is history:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^ http://your_domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^ http://www.your_domain.com/.*$ [NC]
RewriteRule .*\.gif$ - [F,L]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^ http://your_domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^ http://www.your_domain.com/.*$ [NC]
RewriteRule .*\.jpg$ - [F,L]
This will allow gifs and jpgs to be served if the HTTP_REFERER is your domain - and only you. Remember to add additional lines if you have parked domains and/or other subdomains than www! 
__________________
Best regards,
Anders C. Madsen
Golden Planet Support - http://www.goldenplanet.com
|

08-21-2002, 10:26 AM
|
|
Web Hosting Master
|
|
Join Date: Jun 2002
Posts: 1,373
|
|
Quote:
anybody have any examples of this modrewrite?
I know some guy hotlinking my images.. leaeching of my bandwdith damnit.
|
Another less technical image (that I've actually seen done before) is to simply copy the image to another name, and change it on your site -- so if everyone was accessing, say, image.jpg, you would change your site to use image2.jpg. Then replace image.jpg with a blurry 1600x1200 picture of a tree or something... If the leechers are using it inline on their page, their site will look totally screwed up, and they'll quickly take the image down. (Be prepared for the site owner to be piping mad, but it's his own fault  )
The .htaccess file probably works a lot better, but replacing the image is a lot more fun. 
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
| Postbit Selector |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
| Login: |
|
|
| Advertisement: |
|
|
| Web Hosting News: |
|
|
|