重定向但需要弄清楚忽略多站点wordpress结构中.htaccess中的目录

Dre*_*man 5 wordpress mod-rewrite redirect

这是我们在登台服务器上具有的当前.htaccess规则,它可以运行,但会破坏国家/地区站点。\

RewriteEngine  On 
RewriteCond %{HTTP_HOST} ^staging-test.asmarterplanet.com [NC,OR] 
RewriteCond %{HTTP_HOST} ^www.staging-test.asmarterplanet.com [NC] 
RewriteRule ^(.*)$ http://www.ibm.com/blogs/think$1 [L,R=301,NC]
Run Code Online (Sandbox Code Playgroud)

需要找出一种在多站点Wordpress环境中忽略国家/地区站点的方法。仅www.staging-test.asmarterplanet.com目录需要重定向到新的Blogs / think网站

这些是我们需要忽略的站点

/es/
/ch/
/se/
/no/
/nl/
/jp/
/dk/
Run Code Online (Sandbox Code Playgroud)

该目录是我们唯一需要接受重定向“ staging-test.asmarterplanet.com”的站点

Ste*_* E. 0

尝试:

 RewriteCond %{HTTP_HOST} ^staging-test.asmarterplanet.com|www.staging-test.asmarterplanet.com [NC]
 RewriteCond $1 !^(es|ch|se|no|nl|jp|dk)
 RewriteRule ^([^/]*).*$ http://www.ibm.com/blogs/think$0 [L,R=301,NC]
Run Code Online (Sandbox Code Playgroud)

新的重写条件会在允许规则之前检查路径的第一部分是否与任何指定的国家/地区路径不匹配。