Forum Moderators: open

Message Too Old, No Replies

Redirecting people depending on their homepage?

         

emil2k

4:30 pm on Jun 16, 2005 (gmt 0)

10+ Year Member



I was wondering if there was anyway to check whether a certain customer has my page as their homepage and redirect them based on that.

Sathallrin

5:10 pm on Jun 16, 2005 (gmt 0)

10+ Year Member



There is no actualy way to detect if the user's homepage is infact your own.

However, you could check for a referer server-side and if there is no referer, then it could possibly mean that it is their homepage. Although, this would easilly give inaccurate results.

A possibly better method, would be to inbed a hidden iFrame in your page, and tell that iFrame to go to the users homepage (using home() in NN/FF and navigateHomePage() in IE). Then you could check the contents of this iFrame and see if it is your homepage.
You would have to figure out a way to stop the iFrame from loading if the page is inside an iFrame. Because if it is infact your page that loads when directed to the homepage, it would recursively send the user to home in each iFrame below.

Sathallrin

5:47 pm on Jun 17, 2005 (gmt 0)

10+ Year Member



Well, I tested my method out to see if it is possible. IE won't redirect only a frame to the homepage, if you use it the entire page goes home.
In firefox, you can get the homepage to open in a frame. But permission is denied when trying to view any properties of it. This is a good thing (security wise).

I did find this one page with javascripts that might help you out:
[jwscripts.com...]