.htaccess rewrite conditition ignore subdomain

admin

Administrator
Staff member
My main domain is a Wordpress blog, and the .htaccess rewrite for it is as follows...

Code:
 <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
  </IfModule>

This works great, but I have a subdomain in that same directory, and am using this rewrite for it....

Code:
    RewriteCond %{SERVER_PORT} ^443$
    RewriteCond %{HTTP_HOST} ^my\.domain\.com$ [NC]
    RewriteCond %{REQUEST_URI} !^/my/
    RewriteRule ^(.*) /my/$1

That's for my wildcard SSL certificate. This works great, but if the location doesn't exist in the subdomain I get wordpress's error page. I need the wordpress rewrite to ignore the "my" subdomain. How can I do that?

I was thinking something like....

Code:
  <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^my\.domain\.com$ 
    RewriteRule . /index.php [L]
  </IfModule>

But that doesn't work, also tried this....

Code:
  <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^my\.domain\.com - [L,NC]
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
  </IfModule>

Any ideas?