how can I create non-Wordpress sites on subdomains (map them to directories), when I have an active subdomain-multisite WP installation?
Can I insert some .. exemptions into htaccess or something?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityhow can I create non-Wordpress sites on subdomains (map them to directories), when I have an active subdomain-multisite WP installation?
Can I insert some .. exemptions into htaccess or something?
The WP Codex gives two examples of excluding a subdirectory from multisite's control.
Being sure to call the sub rewrite BEFORE the rewrite of ww.domain.com to domain.com
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} subdomain.domain.com
RewriteCond %{REQUEST_URI} !subdomain/
RewriteRule ^(.*)$ subdomain/$1 [L]
# Rewrite http://www.domain.com to domain.com
RewriteCond %{HTTP_HOST} ^www.(.*)
RewriteRule ^(.*) http://%1/$1 [R,L]
This answer to issues with this covers the hierarchical nature of .htaccess to keep in mind: https://wordpress.stackexchange.com/a/20274/118366
Quoting the linked Codex page on this:
If you are able to configure your VirtualHost file this may be the best method. It provides the ability to serve the subdomain out of any directory on your server.
To do this you simply need to make sure that the domain you do not want WPMS to handle is loaded before the WPMS primary domain that uses the wildcard.
Yes. We can add rewrite rule in WordPress root .htaccess
to rewrite all requests for a particular subdomain into a subdirectory.
I could make it work with something like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^sub\.domain\.com$
RewriteRule (.*) sub/directory/index.php [L]
</IfModule>
# BEGIN WordPress
# wordpress generated rewrite rules.
# END WordPress
PS: