记忆不行,只能记录
使用rewrite域名跳转
更换域名了,还是你有好几个域名,都想让他跳转到同一个网址?
用.htaccess的mod_rewrite来实现吧
RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www.panwenbin.com$ RewriteRule ^(.*)$ http://www.panwenbin.com/$1 [R=301,L,NC]
说明:
RewriteEngine On 开启RewriteEngine,需要空间支持mod_rewrite
RewriteBase / 如果在子目录下,把/换成子目录,例如RewriteBase /wordpress
RewriteCond %{HTTP_HOST} !^www.panwenbin.com$ 判定访问的主机名是不是www.panwenbin.com,这里匹配不是
RewriteRule ^(.*)$ http://www.panwenbin.com/$1 [R=301,L,NC] 如果满足上面的条件,重定向所有到http://www.panwenbin.com/下,$1代表前面括号里的内容。R=301是永久改变,对搜索引擎说的。L是last,即不执行下面的规则了。NC是不转义。
| 打印文章 | 这篇文章由admin于2009年4月26日 18:08发表在收集。你可以订阅RSS 2.0 也可以发表评论或引用到你的网站。 |