I would like to redirect an url(A) to another url(B). When url(B) loading, I need to run some code and it might redirect to another url(C).
Example :- Like paypal notification url, I need to run some code in the background when a user browses specific type urls.
Any ideas on how to do this?
You can redirect A to B with a Redirect 301 A B
, and in B's script don't send headers until you have to redirect (or don't). If you have to redirect, send a header("Location: " + $c)
and then exit()
.
The Location
HTTP header along with one of the various 30X HTTP result codes can be used to redirect the client.