Home   Help Login Register  
Welcome, Guest. Please login or register.

Login with username, password and session length

Search
Free Website WooThemes - Quality Themes, Great Support
Pages: [1]   Go Down
Print
Topic: 301 Redirect using PHP - Permanent Redirect HTTP 301  (Read 1476 times)
« on: August 10, 2008, 03:30:43 AM »
Kevin Offline
Newbie

View Profile
*

iTrader: 2
Posts: 72



You can set 301 redirection (Permanent Redirection) using the below PHP code. It helps to search engines to redirect to the new web site:

Code:
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.location-to-new-web-site.com" );
?>
Kevin

Share this topic on AskShare this topic on BlinkbitsShare this topic on BlinklistShare this topic on BloglinesShare this topic on BmarksShare this topic on Del.icio.usShare this topic on DiggShare this topic on DzoneShare this topic on FacebookShare this topic on Feed Me LinksShare this topic on FurlShare this topic on GoogleShare this topic on LiveShare this topic on MagnoliaShare this topic on MySpaceShare this topic on NetvouzShare this topic on NewsvineShare this topic on OneviewShare this topic on RedditShare this topic on RojoShare this topic on ScuttleShare this topic on ShadowsShare this topic on SlashdotShare this topic on SpurlShare this topic on SquidooShare this topic on StumbleUponShare this topic on TechnoratiShare this topic on TwitterShare this topic on TipdShare this topic on YahooShare this topic on Google buzz
Logged
« Reply #1 on: December 14, 2008, 12:40:47 AM »
muckle.martin Offline
Newbie

View Profile WWW
*

iTrader: 0
Posts: 5



Thanks for sharing. Is HTTP/1.1 necessary? I think a Location header would be good enough. Because this might also work with HTTP/1.0 clients.

Quote from: "Kevin"
You can set 301 redirection (Permanent Redirection) using the below PHP code. It helps to search engines to redirect to the new web site:

Code:
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.location-to-new-web-site.com" );
?>
Kevin
Logged
Pages: [1]   Go Up
Print
Jump to:  

Untitled Document
(c) 2010 HELM, WHM, cPanel, ASP, .Net development, PHP, MySQL, MSSQL Server, SEO support forum
Powered by SMF 1.1.16 | SMF © 2011, Simple Machines | Forum style designed by PixelSlot
Web Hosting - Sitemap - XML Sitemap