Search code examples
wordpressapache.htaccessdnsmultisite

WildCard Domains without subdomain mapping


So I am working on WordPress Multisite installation, went to setup the subdomain mapping for the wildcard domains. *.example.com and found the hosting provider this person is using doesn't support wildcard domains. Now I am wondering if their is some sort of work around maybe using .htaccess I started trying somethings but could use some help this is where I am at:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.+)\.example\.com$   [NC]
RewriteCond %{HTTP_HOST} !^www\.example\.com$  [NC]
RewriteRule ^ http://example.com/index.php  [L,R]

Kind of hitting a wall, any help would be greatly appreciated!


Solution

  • If your hosting provider doesn't support wildcard domains you have two options.

    1. switch hoster
    2. manually add the subdomains when you create a sub-site.