Welcome to WebmasterWorld Guest from 54.160.163.163

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Redirect That Won't Allow The User To Go Back

     

narsticle

6:23 pm on Oct 7, 2008 (gmt 0)

10+ Year Member



I am not good at PHP at all so I will ask the experts:

I am looking for some sort of a redirect that will not allow the user to go back.

Lets say the user clicks a banner on Domain1.com

I want that banner to go through a redirect and land on Domain2.com

If the user hits back I want them to not go back to domain1.com. I want to either push them back to domain2.com or send them to a completely different domain; domain3.com

How can I accomplish this?

Thanks greatly.

dreamcatcher

7:13 pm on Oct 7, 2008 (gmt 0)

WebmasterWorld Senior Member dreamcatcher is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You`ve got your work cut out. What is the person opens the banner link in a new tab? I would assume cookies is your best bet.

dc

Demaestro

7:46 pm on Oct 7, 2008 (gmt 0)

WebmasterWorld Senior Member demaestro is a WebmasterWorld Top Contributor of All Time 10+ Year Member



well you can do this if when they click on banners it results in a post. If you make them forms you can pass in values for going_to and came_from

So you would set up a redirect page that your banners post to. Then when users click a banner from Domain1.com... that will result in a post to your redirect page make sure you pass in values came_from and going_to, in this case "came_from=Domain1.com" and "going_to=Domain2.com"

When the request comes into the redirect page simply check the going_to page and force a redirect from this page to the going_to page.

If the user hits back it will repost the form data and they will get redirected back to Domain2.com

If you want to do a redirect to Domain3.com if they hit back then just add in code that checks to see if came_from equals the referrer.... if they hit back it won't and you can redirect to Domain3.com

[edited by: Demaestro at 7:50 pm (utc) on Oct. 7, 2008]

Demaestro

7:46 pm on Oct 7, 2008 (gmt 0)

WebmasterWorld Senior Member demaestro is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Also... I think if you open in a new tab there is no back button.

g1smd

7:48 pm on Oct 7, 2008 (gmt 0)

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



Mess with my UI and you lose me forever.

I won't come back to the site another day.

StoutFiles

8:07 pm on Oct 7, 2008 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



What are you using this for? Do you own Domain1? Are you trying to disable the back button so that people who stumble upon your site can't leave easily...and even worse...redirecting them to sites as link exchanges? If so, I would advise NOT doing this as you won't last long.

If not, then gs1md is right. Do not mess with browser functions such as the back button or no one will be coming back.