.htaccess 的重定向有关问题
程序员文章站
2022-04-11 14:02:50
...
.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]
我目前的.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]
相关文章
相关视频
上一篇: php中六种常用的排序算法