ArticleDirectory
- 2. For Windows hosts, you can use PHP to jump (the method is from the Internet)
1. Linux host, which is the simplest. Modify. htaccess
Modify the WordPress Part Of The. htaccess file as follows:
#Begin WordPress<Ifmodule mod_rewrite.c>Options+Followsymlinksrewriteengine onrewritecond% {Http_host} ^ www. Old.COM [Nc] rewriterule^ (. *) $ Http://Www.new.com/#1 [L, r = 301]</Ifmodule>#End WordPress
Note: www.old.com is replaced with your old domain name, And www.new.com is replaced with your new domain name.
2. For Windows hosts, you can use PHP to jump (the method is from the Internet)
modify the wp-blog-header.php under the WordPress root directory and start with the file Code to PHP:
If ( strtolower ($ _ server ['server _ name'])! = 'Abc. com ') { $ uriredirect = $ _ server ['request _ url' ]; If ( strtolower ( $ uriredirect ) ="/index. PHP ") { $ uriredirect ="/";} header ('HTTP/1.1 301 moved permanently ' ); header ('location: http://abc.com '. $ uriredirect ); exit ();}
Note: Change the two abc.com to your new domain name