Jump to content

way to redirect pages??


Guest doit4God

Recommended Posts

Guest doit4God

I was wondering if there is a way to redirect pages. For example, I have the following pages:page1.phppage2.phppage3.phpWhen people typed in or link from other pages to the following:http://www.mydomain.com/page1.php, I want to redirect to mypage.php?id=1http://www.mydomain.com/page2.php, I want to redirect to mypage.php?id=2http://www.mydomain.com/page3.php, I want to redirect to mypage.php?id=3Is this possible?

Link to comment
Share on other sites

header("Location: mypage.php?id=1");

That's correct, but if there are some pages where linking to page1.php is ok, there would have to be some kind of conditional test first. Perhaps passing a query string with the "ok" link to test whether or not the page1.php should be displayed or redirected....and if the query string value doesn't exist, then you could redirect.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...