homepage Welcome to WebmasterWorld Guest from 54.163.91.250
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

    
need help with redirect depending on domain
need help with redirect depending on domain
kennyb




msg:367841
 2:39 am on Feb 19, 2004 (gmt 0)

I have a site that is getting alot of traffic from strange country domains. The products sold on the site are only available to U.S. customers. So what I need to do is create a script to redirect out of country domains to a specific page.

I'm assuming that we'll use an htaccess script, but any ideas would be appreciated

Kenny

 

balinor




msg:367842
 4:11 am on Feb 19, 2004 (gmt 0)

Hey Kennyb, I've got a similar discussion about BLOCKING specific IPs going on over in the Tracking & Logging forum. I'm guessing you will be able to do that with a MOD REWRITE, but as another member pointed out to me, there are no specific country IP address ranges, so it might be very difficult to achieve.

jimshu79




msg:367843
 4:34 pm on Feb 19, 2004 (gmt 0)

I'm sorry I dont remember the site or company offering this service, but there is a company out there for $20 bucks a month that will redirect a site according to country. so you can have hits from outside the US go to one website, and US hits to a different website...it's possible in that sense.

kennyb




msg:367844
 11:35 pm on Feb 19, 2004 (gmt 0)

Thanks for the posts..

I gues what Im trying to do is block specific domains such as most of the following:
21375: 0.21%: .nl (Netherlands)
20509: 0.20%: .sg (Singapore)
12594: 0.13%: .mx (Mexico)
12518: 0.12%: .jp (Japan)
11686: 0.12%: .be (Belgium)
10397: 0.11%: .br (Brazil)
10828: 0.11%: .nz (New Zealand)
10254: 0.10%: .fr (France)
6950: 0.07%: .no (Norway)
7175: 0.07%: .id (Indonesia)
7983: 0.07%: .ph (Philippines)
7110: 0.07%: .se (Sweden)
6038: 0.07%: .fi (Finland)
5667: 0.05%: .it (Italy)
4435: 0.05%: .gr (Greece)
4940: 0.05%: .de (Germany)
4705: 0.05%: [domain not given]
4181: 0.04%: .dk (Denmark)
4214: 0.04%: .hu (Hungary)
4021: 0.04%: .my (Malaysia)
4936: 0.04%: .ch (Switzerland)
3980: 0.04%: .ar (Argentina)
3504: 0.04%: .pt (Portugal)
3447: 0.04%: .arpa (Arpanet)
3004: 0.03%: .tt (Trinidad and Tobago)
2364: 0.03%: .at (Austria)
2575: 0.03%: .tr (Turkey)
2402: 0.02%: [unknown domain]
2161: 0.02%: .za (South Africa)
2081: 0.02%: .ru (Russia)
2388: 0.02%: .il (Israel)
2116: 0.02%: .do (Dominican Republic)
1539: 0.02%: .cz (Czech Republic)
1799: 0.02%: .ro (Romania)
1664: 0.02%: .hr (Croatia)
1647: 0.02%: .lt (Lithuania)
1269: 0.01%: .pk (Pakistan)
1318: 0.01%: .pl (Poland)
1201: 0.01%: .co (Colombia)
1279: 0.01%: .cl (Chile)
971: 0.01%: .uy (Uruguay)
913: 0.01%: .pe (Peru)
965: 0.01%: .tv (Tuvalu)
1144: 0.01%: .mu (Mauritius)
1000: 0.01%: .es (Spain)
910: 0.01%: .cr (Costa Rica)
765: 0.01%: .in (India)
796: 0.01%: .is (Iceland)
715: 0.01%: .mt (Malta)
530: 0.01%: .ee (Estonia)
578: 0.01%: .mz (Mozambique)
461: 0.01%: .sa (Saudi Arabia)
364: : .bg (Bulgaria)
452: : .aw (Aruba)
354: : .qa (Qatar)
353: : .cy (Cyprus)
290: : .na (Namibia)
222: : .yu (Yugoslavia)
213: : .tc (Turks and Caicos Islands)
246: : .gt (Guatemala)
184: : .info (Informational)
235: : .cc (Cocos (Keeling) Islands)
189: : .tw (Taiwan)
254: : .nu (Niue)
179: : .ws (Samoa)
216: : .sc (Seychelles)
206: : .gy (Guyana)
160: : .jm (Jamaica)
163: : .th (Thailand)
39: : .ie (Ireland)
124: : .lu (Luxembourg)
151: : .ag (Antigua and Barbuda)
164: : .ve (Venezuela)
142: : .hk (Hong Kong)
97: : .lb (Lebanon)
146: : .lv (Latvia)
71: : .py (Paraguay)
61: : .ne (Niger)
71: : .ec (Ecuador)
117: : .bm (Bermuda)
27: : .li (Liechtenstein)
5: : .bz (Belize)
74: : .biz (Businesses)
66: : .bn (Brunei Darussalam)
49: : .mk (Macedonia (Former Yugoslav Republic))
46: : .sm (San Marino)
27: : .af (Afghanistan)
35: : .bs (Bahamas)
66: : .kr (South Korea)
46: : .ky (Cayman Islands)
17: : .ni (Nicaragua)
26: : .lk (Sri Lanka)
26: : .gi (Gibraltar)
16: : .sk (Slovakia)
16: : .ad (Andorra)
37: : .ae (United Arab Emirates)
9: : .ac (Ascension Island)
2: : .to (Tonga)
1: : .si (Slovenia)
4: : .ke (Kenya)

The products sold on the site are not available in these countries and most of the 'hacking' attempts (and successes) have been traced to out of country domains.

Is there a command or series of commands to block domain extensions as opposed to IP addresses?

Any help would be great.. The above stats are for 2 weeks of use on one domain.. So you can inagine how much bandwidth is going out the window.

Kenny

jimshu79




msg:367845
 1:47 am on Feb 20, 2004 (gmt 0)

hmm, unfortunately, this is beyond me...sorry

alexandra




msg:367846
 2:31 am on Feb 20, 2004 (gmt 0)

why not to try .htaccess

Deny users by IP

In your htaccess file, add the following code--changing the IPs to suit your needs--each command on one line each:

order allow,deny
deny from 123.45.6.7
deny from 012.34.5.
allow from all
You can deny access based upon IP address or an IP block. The above blocks access to the site from 123.45.6.7, and from any sub domain under the IP block 012.34.5. (012.34.5.1, 012.34.5.2, 012.34.5.3, etc.) I have yet to find a useful application of this, maybe if there is a site scraping your content you can block them, who knows.

You can also set an option for deny from all, which would of course deny everyone. You can also allow or deny by domain name rather than IP address (allow from .javascriptkit.com works for www.javascriptkit.com or virtual.javascriptkit.com, etc.)

then add
ErrorDocument 403 /123.html

in the .htaccess file, 403 means Forbidden, 123.html is the page you want redirect to.

kennyb




msg:367847
 3:33 am on Feb 20, 2004 (gmt 0)

Thanks for the posts...

My concern is tryin to pin down the specific ips for all those countries... And if I use the domain extension (.nl, .jp, etc), I will run the risk of requiring a domain resolution for every visitor which will slow the server down to a crawl... I guess I could start a databases of ips that I want to block...

Just wondering if there was a simpler solution... or an outside company that makes software to do this.

balinor




msg:367848
 1:22 pm on Feb 20, 2004 (gmt 0)

From bcolflesh in another forum:

The IP-to-Country database should help you:
ip-to-country.webhosting.info/node/view/6

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved