i have two url's (url_x and url_y) both going to one and the same website (website_x). basically url_y is redirected to website_x.
When typing in url_y in the browser I would still like to go to website_x, but i would also like a popup window to appear, that I do not want to pop-up when someone types in url_x, while both url's still point to the same website.
Is this at all possible
thanks
redirection
Moderator: General Moderators
- daven
- Forum Contributor
- Posts: 332
- Joined: Tue Dec 17, 2002 1:29 pm
- Location: Gaithersburg, MD
- Contact:
Couple of ways:
Javascript:
Put this on the index page of url Y (the one you want the message to appear on)
PHP:
Put this on the index page of websiteX (where everything eventually goes to)
NOTE: $_SERVER['HTTP_REFERER'] is not completely reliable. Check out the PHP Manual (Predefined Variables) for documentation
Javascript:
Put this on the index page of url Y (the one you want the message to appear on)
Code: Select all
<script language="javascript">
alert("You are at URL Y");
self.location="www.websiteX.org";
</script>Put this on the index page of websiteX (where everything eventually goes to)
Code: Select all
<?php
if($_SERVER['HTTP_REFERER']=="urlY"){
<script language="javascript">
alert("You came from URL Y");
self.location="www.websiteX.org";
</script>
}
?>