Exclude subdomain from redirecting to index.php

I’m trying to solve a mod_rewrite issue but I can’t seem to wrap my head around it. I tried serval solutions from stackoverflow threads but it isn’t working.

Basically I have a WordPress Multisite installation that forwards subdomains to index.php I want to make and exception for subdomain test.simapro.com so it doesn’t get redirected to index.php but has its normal behaviour. How do I do this?

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*.php)$ $1 [L]
RewriteRule . index.php [L]

Related posts

1 comment

  1. Add a RewriteCond in your last rule:

    RewriteCond %{HTTP_HOST} !=test.simapro.com
    RewriteRule . index.php [L]
    

Comments are closed.