Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stopping certain urls forward to our web server

Status
Not open for further replies.

tobyg

IS-IT--Management
Jan 19, 2005
6
GB
How do we stop a domain from forwarding to our server. Our server only supports one domain. We can block addresses using the .htaccess file but do not know how to block a domain from forwarding to us? We do not want to stop all sites from forwrding just one that is passing itself off as us.

Looking at the web logs the domain being forwarded is arriving at the our server with the referrer field already set for the local domain - I think this means that the referrer field has been modified in transit as the domian does not have CNAME but A records.

Any Ideas?

 
I am not exactly sure how the forwarding they are using is operating. When you type the offending URL into checkdns.org the entry for the webserver gives 'Received: HTTP/1.1 302 Object Moved Location:' So I think this would happen on a CNAME.

Does a CNAME record change the Referrer field to be the destination or are they doing this via script or some sort of Mod rewrite rule?
 
Try this.. Create an .htaccess with
Code:
SetEnvIf Referer [i].domain\.com[/i] block_this
Order Allow, Deny
Allow from All
Deny from env=block_this

Replace the domain.com with the offending servers domain.

 
I will try what you have suggested but I believe that the referer field has already been modified to be our url by the time our web server receives the request.

I will post back my result as soon as I can get back onto the server, I left the password in the office.

Many thanks for your time, so far.
 
I have created the .htaccess file as suggested and it has not stopped the forward. The browser log files never show the referer as the offending domain.

I have been told that the offending domain is using a 302 response to get to our site, which makes the browser just send a new request to the stated address.

Any ideas on how to handle this?
 
That's a pickle.. try this!
Code:
<Directory [i]/[URL unfurl="true"]www/document[/URL] root[/i]>
Order Deny, Allow
Deny from [i]offending ip address[/i]
Allow from All
</directory>

 
I have tried that and still no joy
 
There's no way you're going to be able to stop this within you're apache, any more than you could stop someone entering your URL into their browsers. The only thing you'll be able to do is contact the owners of the offending site.
 
OK - Many thanks for all the input
 
There's no way you're going to be able to stop this within you're apache"

If the user clicks a link from an offending server apache can restrict the $ENV{'REMOTE_ADDR'} using the mod_access.

I do this all the time whether it be protecting scripts to restricting domains/ip addresses.

 
Those trying to solve this problem by using remote ip methods will find it futile as the "problem" computer is the server redirecting people, and not the person being redirected. Since the server is redirecting the visitor and the visitor's computer is not sending referrer information from the offending site, it will not be possible to block based on referrer either.
I admit, I do not have a solution to this problem, however, I will address your earlier question regarding CNAME, as a CNAME will not change any referrer field or anything like that. As far as the browser is concerned, the site is where it's going, it doesn't care that it's a CNAME for their Akamai server pool. When it contacts the server, it's still going to send the name ' when it talks to it, it's not going to use ' except to lookup the ip it needs to connect to.

---------
HTH
Gavin Ostlund
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top