homepage Welcome to WebmasterWorld Guest from 50.17.7.84
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / WordPress
Forum Library, Charter, Moderators: lorax & rogerd

WordPress Forum

    
Windows host to modify the WordPress function to achieve a 301 redirec
modify the WordPress function to achieve a 301 redirec
kerrylee




msg:4430198
 2:48 am on Mar 17, 2012 (gmt 0)

Hello, everyone, I'm from China.Today I share with you about amending the wordpress function to achieve a 301 redirect,This function is wp-blog-header.php,The specific process is as follows:

1.To find the root of the site following the wp-blog-header.php file, make a backup
2.The use of professional programming tool to open this file, I am using Dreamweaver
3.The best place to start of file, enter the following code:
<?php
if (strtolower($_SERVER['SERVER_NAME'])!='www.kerry86.com')
{
$URIRedirect=$_SERVER['REQUEST_URI'];
if(strtolower($URIRedirect)=="/index.php") { $URIRedirect="/"; }
header('HTTP/1.1 301 Moved Permanently');
header('Location:http://www.kerry86.com'.$URIRedirect);
exit();
}

?>

4.To cover the wp-blog-header.php file of the web root directory

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / WordPress
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved