MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Technical Helps => Topic started by: chrisf on 2014-07-02, 03:46:35

Title: wildcard * subdomain
Post by: chrisf on 2014-07-02, 03:46:35
Adding a wildcard A record to dns fails with:

Alert: Invalid subdomain *

How to add a wildcard A record?  I want to use htaccess to redirect to sub directories, using:
Code: [Select]
# if we have not already rewritten this request to a subdomain-subdirectory
RewriteCond %{ENV:REQ_SUBDOMAIN} ^$
# and if valid hostname, get requested subdomain into local variable %2
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9][-a-z0-9]+)\.example\.com(:80)?$ [NC]
# and if the requested subdomain is not "www"
RewriteCond %{HTTP_HOST} !^www\.example\.com
# and if the subdirectory for this subdomain exists
RewriteCond %{DOCUMENT_ROOT}/addons/%2 -d
# then rewrite the request to the subdirectory, set the loop-prevention variable, & quit for this pass
RewriteRule (.*) /addons/%2/$1 [E=REQ_SUBDOMAIN:%2,L]

But need dns to resolve all * .example.com.  It is my understanding this is a A record.  Also setting priority after other set A records?
Title: Re: wildcard * subdomain
Post by: MRatWork on 2014-07-02, 08:49:15
Add in 'server alias'.