B2B Articles - July 23, 2010
This brief article will provide code samples for creating 301 redirects in PHP.
A 301 redirect is an easy and SEO friendly way to redirect a page that has changed address. For example, if you website recently changed Content Management Systems, and the new CMS generates a different URL construct, then you may want to redirect key pages so the user does not experience an (404) error.
A 301 redirect will also help preserve the PageRank assigned to that page prior to the move. So even if you aren't concerned about visitors stumbling upon a 404 error, you may want to at least tell Google that your page has moved.
<?php
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: https://www.example.com" );
?>
Also, redirect with location header:
<?php
header('Location:https://www.example.com');
exit;
exit();
?>
Or, redirect with “Refresh” header:
<?php
header('Refresh: 0; URL=https://www.example.com');
exit;
exit();
?>
Tel 212-993-7809
Ironpaper ®
10 East 33rd Street
6th Floor
New York, NY 10016
Map
First-party data marketing
SEO for B2B
Customer journey strategy
ABM Agency
Marketing for IoT Companies
HubSpot Implementation
B2B Product Marketing
Measurable Marketing
IoT go-to-market strategy
IT Marketing
HubSpot for ABM
Go to market strategy
Technology Marketing
Marketing for IT Companies
ABM Campaigns
B2B lead generation
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.