User Tools

Site Tools


php_redirects

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

php_redirects [2016/11/25 22:38] (current)
Line 1: Line 1:
 +===== PHP Redirects =====
 +
 +To create a redirect in PHP from one location to another create an index.php containing the following:
 +
 +  <?
 +  header("​location:​ <​newlocation>"​);​
 +  ?>
 +
 +Such as:
 +
 +  <?
 +  header("​location:​ http://​www.myotherdomain.com/"​);​
 +  ?>
 +
 +or
 +
 +  <?
 +  header("​location:​ thedirbelow/"​);​
 +  ?>
  
php_redirects.txt ยท Last modified: 2016/11/25 22:38 (external edit)