Welcome to WebmasterWorld Guest from

Forum Moderators: DixonJones & mademetop

Message Too Old, No Replies

How to customize index to be opened at preselected IP locations

Your visitors to open a customized opening page according to their IP

5:46 pm on Oct 19, 2009 (gmt 0)

New User

5+ Year Member

joined:Jan 1, 2009
posts: 17
votes: 0

How to set up customized index to be opened at predetermined IP ranges ? For example if you want visitors from certain countries or cities open a different index opening page as they visit your site, how this can be done to detect the IP and launch opening index page A, B or C ?

First, to detect the IP the visitor is from, and according to it, to launch a parent page to be seen by that visitor, as a welcome mesage for instance.
(If it launches as blank page and they have a pop-up blocker it wont be useful)

Since Im not such an expert I seek help to copy/paste/edit the code lines you may share here. Thanks!

6:08 pm on Oct 19, 2009 (gmt 0)

Moderator from GB 

WebmasterWorld Administrator ianturner is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 19, 2001
posts: 3597
votes: 35

Detect the IP server side and then use PHP/ASP/.Net to deliver the appropriate content.

The IP will be available from the HTTP Request.

10:58 pm on Oct 19, 2009 (gmt 0)

New User

5+ Year Member

joined:Jan 1, 2009
posts: 17
votes: 0

My expertise is not enough since Im not a programmer, so I wonder if what you indicate is into lay terms something as:

First: I need to install some IP detector code on my index (some you may suggest?)
Second: Add some code lines with conditional contents:
-IF a visitor comes from a specific number of IP, lets say, >proceed to forward to index A;
-IF visitor comes from IP starting with 188 ( Switzerland) then proceed to forward to index B;
-IF proceeds from IP ranging from 189.#*$!.x.#*$! ... to 200.#*$!.#*$!.#*$! then proceed to forward to show index C.
- All the rest just show the default index opening page.

I do appreciate your concern and courtesy in answering. I would like to be such an expert as to pick up your advise and program advanced PHP and all you mentioned. Since Im not so proficient, I wonder if it would be possible to get the lines of code to do this and copy/paste/edit them into my index. Or point me some tutorial or link to follow through.

5:50 am on Oct 20, 2009 (gmt 0)

Senior Member

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

joined:Oct 25, 2006
posts: 1042
votes: 0

I would suggest the following correct procedure:
1. Install GEO db form link: [maxmind.com...]
2. $_SERVER['REMOTE_ADDR']; to get the IP Address of Visitors.
3. PHP code to read database:
4. Redirection of URL:
4.1. to redirect a user from the page they entered to a different web page. One reason you may want to do this is that the page they are trying to access no longer exists. 4.2. seamlessly can be transfered to the new page without having to click a link to continue:
header( 'Location: [mywebsite.com...] ) ;
5. You should be aware that languages should be within folders like en-GB. Google notices these folders...

Bingo, you are on the way to automatic detect language.

10:56 pm on Nov 6, 2009 (gmt 0)

New User

5+ Year Member

joined:Jan 1, 2009
posts: 17
votes: 0

Toplisek, thank you for your advise.
In the meanwhile I discovered web-stat.com who also offer this service of geolocation very easy as well as others such as monitoring of LIVE visitors with lots of stats.
Your post is most appreciated.

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members