Redirecting, but need to figure out to ignore the directory in .htaccess in the layered wordpress structure

There is the current .htaccess rule that we have on our intermediate server, and it works, but it breaks down the sites of the country. \

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]

You need to figure out a way to ignore country sites in a multi-level Wordpress environment. Only the www.staging-test.asmarterplanet.com directory should redirect to new blogs / website for discussion

These are the sites we need to ignore.

/es/
/ch/
/se/
/no/
/nl/
/jp/
/dk/

This directory is the only site we need to accept the redirect "staging-test.asmarterplanet.com"

+4
source share
1 answer

Try:

 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]

Rewrite , , .

0

Source: https://habr.com/ru/post/1609992/


All Articles