IP address redirect???
Any of you web (HTML) gurus know if it's possible to put a redirect into the HEAD of a page that will only redirect certain IP address (or visitors from certain domains)?
I have a few pages that the FAA and Delta are using A BUNCH (users from xxx.faa.gov and xxx.delta.com on the server log) and I'd prefer that they didn't use so much of my bandwidth. Could I set up a redirect that would send only those IP/domains to say a porn site or something to make their work day a little more exciting?
I'm guessing it can be done, kinda like a browser sniffer action but look at the IP instead. I'm just not sure if it would be embedded in the page, or a SSI, or?
Thanks -
I have a few pages that the FAA and Delta are using A BUNCH (users from xxx.faa.gov and xxx.delta.com on the server log) and I'd prefer that they didn't use so much of my bandwidth. Could I set up a redirect that would send only those IP/domains to say a porn site or something to make their work day a little more exciting?
I'm guessing it can be done, kinda like a browser sniffer action but look at the IP instead. I'm just not sure if it would be embedded in the page, or a SSI, or?
Thanks -
Pretty easy to do with server side programming, and depending on what kind of server side technology you're using, I might be able to help you.
If your site is all static html, you'll still be able to do it via JavaScript. But visitors could just turn off javascript to get around your redirect, though.
If your site is all static html, you'll still be able to do it via JavaScript. But visitors could just turn off javascript to get around your redirect, though.
Originally posted by PeaceLove&S2K
Pretty easy to do with server side programming, and depending on what kind of server side technology you're using, I might be able to help you.
If your site is all static html, you'll still be able to do it via JavaScript. But visitors could just turn off javascript to get around your redirect, though.
Pretty easy to do with server side programming, and depending on what kind of server side technology you're using, I might be able to help you.
If your site is all static html, you'll still be able to do it via JavaScript. But visitors could just turn off javascript to get around your redirect, though.
Thanks for the help!
Originally posted by The Unabageler
use php or somethin...or you could use mod_rewrite if you're on apache
use php or somethin...or you could use mod_rewrite if you're on apache
Maybe someday, I'll have the time (and mentors) to figure it out.
Cheers -
I'm assuming SSI works on your webserver. If so, try this:
[CODE]
<script language="javascript">
var strRedirectURL = "http://www.goatse.cx";
var strRemoteHost = "";
var arrBannedDomainsRE = [/^.+.faa.gov$/g, /^.+.delta.com$/g];
for (var i = 0; i < arrBannedDomainsRE.length; i ++) {
[CODE]
<script language="javascript">
var strRedirectURL = "http://www.goatse.cx";
var strRemoteHost = "";
var arrBannedDomainsRE = [/^.+.faa.gov$/g, /^.+.delta.com$/g];
for (var i = 0; i < arrBannedDomainsRE.length; i ++) {
Trending Topics
Can the same script use for filtering or redirecting IE and Netscape users?
[QUOTE]Originally posted by PeaceLove&S2K
[B]I'm assuming SSI works on your webserver. If so, try this:
[CODE]
<script language="javascript">
var strRedirectURL = "http://www.goatse.cx";
var strRemoteHost = "";
var arrBannedDomainsRE = [/^.+.faa.gov$/g, /^.+.delta.com$/g];
for (var i = 0; i < arrBannedDomainsRE.length; i ++) {
[QUOTE]Originally posted by PeaceLove&S2K
[B]I'm assuming SSI works on your webserver. If so, try this:
[CODE]
<script language="javascript">
var strRedirectURL = "http://www.goatse.cx";
var strRemoteHost = "";
var arrBannedDomainsRE = [/^.+.faa.gov$/g, /^.+.delta.com$/g];
for (var i = 0; i < arrBannedDomainsRE.length; i ++) {
You mean will the script in both IE and Netscape? I think so, though I haven't tested it with Netscape.
If you mean you want to allow only users of browsers other than IE and Netscape to visit your site, you'll have to modify it slightly.
Also keep in mind that:
1. Person from faa.gov and delta.com will still be able to hit your homepage once before getting redirected. So while the number of hits from that domain will hopefully be reduced, it won't be eliminated.
2. The script does not prevent search indexing bots from visiting your site still (thus if that's the source of your increased bandwidth usage, this won't solve your problem)
3. Someone can turn off javascript on their browser to work around this script.
To truly block someone would require some server side work - modifying web server configuration, for instance.
If you mean you want to allow only users of browsers other than IE and Netscape to visit your site, you'll have to modify it slightly.
Also keep in mind that:
1. Person from faa.gov and delta.com will still be able to hit your homepage once before getting redirected. So while the number of hits from that domain will hopefully be reduced, it won't be eliminated.
2. The script does not prevent search indexing bots from visiting your site still (thus if that's the source of your increased bandwidth usage, this won't solve your problem)
3. Someone can turn off javascript on their browser to work around this script.
To truly block someone would require some server side work - modifying web server configuration, for instance.
Thread
Thread Starter
Forum
Replies
Last Post
s2kdriver80
Off-topic Talk
11
Apr 11, 2003 02:31 PM




