Next Spaceship

Driving into future…

How to Redirect to a New Page

| Comments

This is an example that shows how to redirect (forward) to a new page in PHP.

PHP Redirect Code
1
2
3
4
<?php
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: http://leons.im/about/");
?>

Note that with 301 error No., instead of 302 error No., your page is Search Engine Optimized, ie the search engine can retain the original page rank for your new page.

Comments