.htaccess 的重定向有关问题

WBOY
Release: 2016-06-13 13:41:19
Original
874 people have browsed it

.htaccess 的重定向问题
我目前的.htaccess文件是这样的

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.tk0752.com$ [NC]
RewriteRule ^(.*)$ http://www.tk0752.com/$1 [L,R=301]

把所有xizi.tk域名原来的地址转移到tk0752.com下
但是我现在xizi.tk下面建立了二级域名1.xizi.tk,2.xizi.tk等,不希望进行重定向。
怎么适当修改这个文件呢



------解决方案--------------------
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.tk0752.com$ [NC]
RewriteRule ^(.*)$ http://www.tk0752.com/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^tk0752.com$ [NC]
RewriteRule ^(.*)$ http://www.tk0752.com/$1 [L,R=301]
------解决方案--------------------
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^[^12].tk0752.com$ [NC]
RewriteRule ^(.*)$ http://www.tk0752.com/$1 [L,R=301]

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!