Link to home
Start Free TrialLog in
Avatar of BCrawler
BCrawler

asked on

php statement to redirect browser based on page id

I would like to include an if statement to my header file and instruct it to redirect to another url if the requested page id is xy.

Reason is, as I have it currently, the browser first loads the header and certain stock content before being redirected. I dont want the browser to even load those.

Is there any way to do that with php and if so, can some one give me an example?

here is the site --wwwsattaluri.com/amazon

I have the site linked to a wordpress blog from the menu. If you click blog on menu....But it loades graphics first. I have access to the header file. So, I was thinking of using a check to see if the current page being loaded is particular and if so, redirect.

Thanks.
Avatar of Insoftservice inso
Insoftservice inso
Flag of India image

hi,

did u try this one header()

if($id ='xy')
{
$uri = "www.yahoo.com";
  header("Location:$URI");exit;

}
ASKER CERTIFIED SOLUTION
Avatar of Rarek
Rarek

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BCrawler
BCrawler

ASKER

Just what I needed. Thank you.