Internet
Fact-checked

At WiseGEEK, we're committed to delivering accurate, trustworthy information. Our expert-authored content is rigorously fact-checked and sourced from credible authorities. Discover how we uphold the highest standards in providing you with reliable knowledge.

Learn more...

What is PHP Redirect?

R. Kayne
R. Kayne

A PHP redirect is a small bit of code embedded in a webpage that takes the surfer to a new webpage automatically. PHP once stood for Personal Home Page, though the term “PHP” is now used independent of that original meaning. The code was created in 1994 by Rasmus Lerdoff for his personal use, then released as PHP public code in 1995, with current implementations by The PHP Group. It is a standardized free scripting language.

A PHP redirect can be handy for webmasters that want visitors to bypass a defunct webpage and enter a new page at a different location or website address. Established search engine links along with links from other websites will continue to direct traffic to a defunct site long after a page has been taken down or the address has changed. Rather than lose that traffic, the webmaster can keep the old page posted to the Web server with just the PHP redirect code. This forwards visitors to the new page or site without making them click an additional link.

A PHP redirect is a small bit of code embedded in a webpage that takes the surfer to a new webpage automatically.
A PHP redirect is a small bit of code embedded in a webpage that takes the surfer to a new webpage automatically.

A PHP redirect can be employed a number of ways. While it is recommended all extraneous content or code on the page be removed, one can include a message to the surfer that the address of the page being sought has changed. The message also typically states that the surfer is being redirected, and suggests that bookmarks be updated to reflect the new address.

In the simplest form, PHP redirects the visitor seamlessly. Unless the surfer notices the uniform resource locator (URL) field in the Web browser, the new location will go unnoticed all together. This might not be the best choice if you want the new page bookmarked. A PHP redirect is not meant to be used indefinitely.

Unfortunately, redirects can also be used in phishing schemes or to siphon traffic from legitimate sites. In the latter case people are redirected from "decoy links" posing as legitimate sites. Traffic is redirected to offensive sites where mousetrapping is employed to get click revenue from surfers trying to click their way out. This misuse of redirects is called pagejacking.

Some browsers or their add-ons will protect surfers against being redirected. With this type of protection enabled the surfer might not be permitted to be redirected, or might be warned and asked to click a button to allow it.

Despite abuse by unscrupulous persons, PHP redirect code is handy to have on hand for nearly any webmaster. The code is freely available on many webpages, along with suggestions on how to implement it. If your Web host does not support PHP scripting, HTTP and JavaScript redirects are also widely published.

Discuss this Article

Post your comments
Login:
Forgot password?
Register:
    • A PHP redirect is a small bit of code embedded in a webpage that takes the surfer to a new webpage automatically.
      By: anyaberkut
      A PHP redirect is a small bit of code embedded in a webpage that takes the surfer to a new webpage automatically.