PHP on page 301 redirect

I needed to redirect traffic from one page to another without using the .htaccess file.

I also wanted to let any search engines know that may have indexed the file of its new location.

By using a 301 redirect it would let search engines know to index the new page instead of the original page.

As the page was a .php I have achieved this redirect by using the following PHP (PHP: Hypertext Preprocessor) code:

header("HTTP/1.1 301 Moved Permanently");


You may also like...