全球主机交流论坛

标题: 求教如果在子目录的WP xxx.com/so.Yoia如何301到xxx.com/blog [打印本页]

作者: yun    时间: 2012-2-18 19:45
标题: 求教如果在子目录的WP xxx.com/so.Yoia如何301到xxx.com/blog

以前在子目录so.Yoia中建立了一个WP现在我要换成xxx.com/blog
首先我在后台后台修改了默认连接改为xxx.com/blog ,现在可以访问新的后台和文章。但现在可以访问老站现实404.没有301
我该怎么写301呢?
在根目录的.htaccess写还是子目录so.Yoia中.htaccess写呢?
该如何写呢?
日志 tag 301 怎么写啊·~??

作者: 小陈    时间: 2012-2-18 19:46
重复了
作者: yun    时间: 2012-2-18 20:02
嗯啊·~
作者: miniloop    时间: 2012-2-18 20:17
本帖最后由 miniloop 于 2012-2-18 20:20 编辑

根目录下如果有htaccess就加
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} *so\.Yoia* [NC]
RewriteRule ^(.*)$ http://xxx.com/blog/$1 [R=301,L]

也可以在so.Yoia下加个htaccess文件:
Redirect permanent xxx.com/so.Yoia xxx.com/blog



作者: yun    时间: 2012-2-18 20:24
miniloop 发表于 2012-2-18 20:17
根目录下如果有htaccess就加
RewriteEngine On
RewriteBase /

返回状态码:404
网页返回HEAD信息如下
Date: Sat, 18 Feb 2012 12:27:05 GMT
Server: LiteSpeed
Connection: Keep-Alive
Keep-Alive: timeout=5, max=100
Cache-Control: private,no-cache,max-age=0
Pragma: no-cache
Content-Type: text/html
Content-Length: 389
作者: yun    时间: 2012-2-18 20:25
找到解决方法了~·
RewriteEngine On
RewriteRule ^(.*)$ http://www.26kg.cn/qiupidayi/$1 [R=301,L]




欢迎光临 全球主机交流论坛 (https://loc.fffk.eu.org/) Powered by Discuz! X3.4