HOME
DOMAIN
WEB HOST
AUTO Site
VPS SERVER
CLOUD HOST
SERVER
HK HOST
AGENT
SERVICE
使用 HTACCESS 文件 添加吧,这是代码:
Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^domain.com[NC] RewriteRule ^(.*)$ http://www.phpfensi.com/$1 [L,R=301]
php写法:
<? Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: www.phpfensi.com" ); ?>
不带index.php文件:
<?php $qurl = $_SERVER['REQUEST_URI']; //获取url,伪静态地址也能完整取得 $qurl = str_replace("/index.php","",$qurl); if ($qurl!=""){ header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.phpfensi.com"); exit();} ?>