1.重定向tengmu.net到www.tengmu.net
这种重定向旨在使域名唯一,是网站SEO必须要做的,后面重定向www.tengmu.net到tengmu.net也是出于同样的原因,只是形式不同。打开.htaccess文件,加入以下规则。(下面的规则是针对主域名的,子域名要修改)
- RewriteEngine On
- RewriteCond %{HTTP_HOST} !^www.tengmu.net$ [NC]
- RewriteRule ^(.*)$ http://www.tengmu.net/$1 [L,R=301]
2.重定向www.domain.com到domain.com
- RewriteEngine On
- RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
- RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
3.重定向olddomain.com到www.newdomain.com
- RewriteEngine On
- RewriteCond %{HTTP_HOST} !olddomain.com$ [NC]
- RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301]
4.重定向olddomain.com to newdomain.com
- RewriteEngine On
- RewriteBase /
- RewriteCond %{HTTP_HOST} !olddomain.com$ [NC]
- RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]
5.重定向domain.com/file/file.php 到 otherdomain.com/ofile/ot.php
- RewriteCond %{HTTP_HOST} ^www.domain.com$
- RewriteRule ^file/file.php$ http://www.otherdomain.com/ofile/ot.php [R=301,L]
转载注明链接:http://www.hostloc.net/Article/301_htaccess01.aspx
本站网赚论坛 网站建设教程,seo教程,网站推广,网赚教程 用户交流群QQ:500人超级群:142791698 200人高级群:36121207
已经测试 可以使用
感觉我的还好啊
不错 很有见解
互联网行业还是有出路的啊
过来看看博主,求密码,O(∩_∩)O哈哈~
每次路过市政府的时候看到旁边挂着的大牌子上面写着“发展才是硬
嘿嘿 我以前是用这个做idc的 后来还是做博客了 IDC转至tengmu.ne
啊哈~这儿的老路都是随山走的~ 话说上次我从hostloc点过来的时候
博客交换友情链接~http://www.no1vps.com 有兴趣邮件我~~混主机
Powered by Bitrac,天明博客 交换链接 请联系站长 QQ:13571223
360网站安全检测平台
.