473,383 Members | 1,880 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Displaying a different website based on source internet address ?

Hello,

Based on the source internet address a different version of the website
should be presented/served to the user/browser.

For example in pseudo code:

if SourceAddress = '143.3.5.1' then
begin
ShowBlueWebsite; // Load/Show BlueIndex.htm
end else
if SourceAddress = '124.5.15.7' then
begin
ShowRedWebsite; // LoadShow RedIndex.htm
end;

Is this possible with java script ? is there any source code available
to do this trick ?

Bye,
Skybuck.

Aug 29 '06 #1
2 1364
document.location.host contains the host portion of the URL (in your
case an IP).

You could use that in a script on your main index page to send a
redirect.

The problem is, what happens if someone without javascript enabled
shows up on your site?

I would recommend having one or the other be default (let's say
index.html is defult and it is the blue page). Then you could put your
script on that blue page. Check the host and if the host is 124.5.15.7
we'll show redindex.html page instead.

So a simple example (this goes in the head section of index.html which
refers to blue page) would be:

<script type="text/javascript">
if (document.location.host == "124.5.15.7") {
document.location = "/redindex.html";
}
</script>

Aug 29 '06 #2
"Skybuck" <sk*********@hotmail.comwrote in news:1156872351.238223.87460
@m79g2000cwm.googlegroups.com:
Based on the source internet address a different version of the website
should be presented/served to the user/browser.
What do you mean by "the source internet address"? Perhaps you mean the
"referer" or "referring page" (the URL of the previous webpage from which a
link was followed).
Aug 29 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: john Q | last post by:
I found a PHP based email obfuscator for use in websites, where the source HTML (PHP, actually) file doesn't contain the actual email address in the Mailto tag, but generates it and that...
5
by: CreepieDeCrapper | last post by:
i have a simple JS window.open function that i'm calling and it works great here: http://demo.creationsite.com/GLBC/www/ (click on "virtual tour" in the yellow text link) - no status bar -...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
9
by: Justin Engelman | last post by:
Hi, I have a website that uses an ISAPI filter that will redirect anyone going to any page on the site to an SSL login page (on a different website with the same root domain) if they do not have...
3
by: Navodit | last post by:
Hi I have a very basic question regd retrieving information from website using a scripting language: Basically I am working on the development of a database where a user enters an address...
5
by: Skybuck | last post by:
Hello, Based on the source internet address a different version of the website should be presented/served to the user/browser. I would like to keep the script as simple as possible and it...
1
by: Skybuck | last post by:
Hello, Based on the source internet address a different version of the website should be presented/served to the user/browser. For example in pseudo code: if SourceAddress = '143.3.5.1'...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
7
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.