0
我正在组织一个客户网站到几个子域。我已经使用以下内容将oldsite.com/blog-post-name上的所有帖子重定向到blog.oldsite.com/blog-post-name,它的功能就像一个魅力。但是,我们希望oldsite.com,oldsite.com/page1和oldsite.com/page2保持原样,不会被重定向到子域。我觉得我应该可以为适用的页面添加一个例外 - 只有5个 - 但我无法弄清楚这个例外应该如何阅读。作为参考,oldsite.com位于根目录中,WordPress文件位于oldsite/subdomain /子文件夹中。htaccess重定向WordPress的帖子,但不是页面子域
oldsite.com的htaccess:
RewriteEngine on
RewriteBase/
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/$
RewriteRule ^(.*)$ http://blog.oldsite.com/$1 [R=301,L]
更新
旧代码开始打破了主题CSS,并顺带正因为此,在新的代码。我认为这个消极的情况是与基本的WP htaccess战斗。这是我目前所拥有的:
RewriteEngine on
RewriteBase/
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/$
RewriteCond %{REQUEST_URI} !^(repairs|contact)/?$
RewriteRule ^(.*)$ http://blog.oldsite.com/$1 [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
我应该在WP集内添加条件吗?为什么上面的代码工作之前(是的,WP代码)?