headerIMG

B2B Articles - October 17, 2010

PHP 301 Redirect Code

Here is how to use PHP to create a permanent 301 redirect. This type of redirect tells user-agents that the webpage has moved permanently to the new, referenced location. Using 301 redirects can be a vital part of a search engine optimization (SEO) practice.

In order to use this code properly, you will need to place the PHP snippet above all content on the page. By placing the PHP 301 redirect code within or below other content will result in an error like the following: Warning: Cannot modify header information - headers already sent by...

<?php
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: https://test.com" );
?>

Please note: Replace "https://test.com" with your new location for the webpage.

Tel 212-993-7809  

Ironpaper ®
10 East 33rd Street 
6th Floor
New York, NY 10016
Map

Ironpaper - B2B Agency

B2B Marketing and Growth Agency.

Grow your B2B business boldly. Ironpaper is a B2B marketing agency. We build growth engines for marketing and sales success. We power demand generation campaigns, ABM programs, create B2B content, strengthen sales enablement, generate qualified leads, and improve B2B marketing efforts.

Ironpaper Twitter Ironpaper Linkedin