How to Use PHP to Define Redirects?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
terrynowk
Forum Newbie
Posts: 6
Joined: Thu Jun 11, 2009 4:10 am

How to Use PHP to Define Redirects?

Post by terrynowk »

What I am trying to do:

URL-X redirects to URL-Y.
These URL's are external sites that I do not own.

How can php be used to output something like "URL-X redirects to URL-Y".

Example for clarification:

1. redirect.com/redirect.php redirects to example.com/somepage.php.
2. When giving php the url redirect.com/redirect.php as input,
I want php to output "redirect.com/redirect.php redirects to example.com/somepage.php".

Appreciate your answers :)
marty pain
Forum Contributor
Posts: 105
Joined: Thu Jun 11, 2009 5:32 am
Location: Essex

Re: How to Use PHP to Define Redirects?

Post by marty pain »

Suggest you read up on HTTP Headers, and how they can be sent using PHP.
Post Reply