【发布时间】:2016-05-12 06:27:09
【问题描述】:
我刚刚在地址 http://lifeworks.life 上推出了一个新网站(基于 Wix)。我已经在http://lifeworkslearningcetner.com/archive 存档了旧网站(WordPress),将除一个.htaccess 文件之外的所有文件从http://lifeworkslearningcenter.com 的根文件夹中移出,以保持重定向和SEO 源源不断。
我有特定的重定向工作,以及根级重定向。但是现在,http://lifeworkslearningcenter.com/archive 的 URL 重定向到了 https://www.lifeworks.life/archive,它不存在并以 404 结尾。
这是我正在使用的 .htaccess 代码。我想要的是能够正常访问/archive文件夹中的WordPress站点,前端和后端都可以。
RewriteEngine on
RewriteCond %{HTTP_HOST} ^lifeworkslearningcenter\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifeworkslearningcenter\.com$
RewriteRule ^about-lifeworks$ "https\:\/\/www\.lifeworks\.life\/team\.html" [R=301,L]
RewriteCond %{HTTP_HOST} ^lifeworkslearningcenter\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifeworkslearningcenter\.com$
RewriteRule ^services$ "https\:\/\/www\.lifeworks\.life\/services\.html" [R=301,L]
RewriteCond %{HTTP_HOST} ^lifeworkslearningcenter\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifeworkslearningcenter\.com$
RewriteRule ^methodology$ "https\:\/\/www\.lifeworks\.life\/approach\.html" [R=301,L]
RewriteCond %{HTTP_HOST} ^lifeworkslearningcenter\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifeworkslearningcenter\.com$
RewriteRule ^sign-up$ "https\:\/\/www\.lifeworks\.life\/enroll\.html" [R=301,L]
RewriteCond %{HTTP_HOST} ^lifeworkslearningcenter\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifeworkslearningcenter\.com$
RewriteRule ^rates-and-policies$ "https\:\/\/www\.lifeworks\.life\/policies\.html" [R=301,L]
RewriteCond %{HTTP_HOST} ^lifeworkslearningcenter\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifeworkslearningcenter\.com$
RewriteRule ^contact-us$ "https\:\/\/www\.lifeworks\.life\/contact\.html" [R=301,L]
RewriteCond %{HTTP_HOST} ^lifeworkslearningcenter\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifeworkslearningcenter\.com$
RewriteRule ^blog$ "https\:\/\/www\.lifeworks\.life\/blog\.html" [R=301,L]
Redirect 301 / http://lifeworks.life/
【问题讨论】:
标签: wordpress apache .htaccess redirect