Redirecting but need to figure out to ignore a directory in .htaccess in a multisite wordpress structure

Heres the current .htaccess rule we have on our staging server and it works but it breaks the country sites.

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]

Need to figure out a way to ignore the country sites within a multisite WordPress environment. Only the www.staging-test.asmarterplanet.com directory needs to redirect to the new blogs/think site

Read More

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 “

Related posts

1 comment

  1. 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]
    

    The new Rewrite condition checks that the first part of the path does not match any of the specified country paths before allowing the rule.

Comments are closed.