PHP Questions Home

Categories

Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website


PHP Functions

PHP Functions


More PHP

Top Questions
Ask a Question

How do I perform a 301 redirect with PHP?


Performing a 301 re-direct with PHP is a more and more common question people ask, due to the emphasis on making sure that ranking points aren't lost and duplicate content issues are resolved as best as is possible.

Luckily to perform a 301 permanent re-direct from one location to another is very easy with PHP, here's how:

<?php
Header
("HTTP/1.1 301 Moved Permanently" ); 
Header("Location: http://www.theothersite.com");
?>



More website PHP Questions

How to find a domain name for an IP address?
How do I display todays date on my website?
How do I find a visitors IP address?
How do I send HTTP headers with PHP?
How can I find out where a site visitor comes from?