1. Apache模块 开启rewrite
2..htaccess文件中
<IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTP_HOST} ^qdaikuan.cn$ RewriteCond %{HTTP_HOST} ^qdaiwang.com$ RewriteCond %{HTTP_HOST} ^www.qdaikuan.cn$ RewriteCond %{HTTP_HOST} !^$ RewriteRule ^(.*)$ http://www.qdaiwang.com/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L] </IfModule>
时间: 2024-11-07 23:53:20