[BlueOnyx:06131] wildcard domains and mod_rewrite

Germano Soru germano at soru.me.uk
Wed Dec 15 16:42:44 -05 2010


Hi,

 

I just had a quick question that I've been asking in relevant chat rooms and
forums and everyone seams to bicker rather then help.

 

I obviously can't control everyone's NS settings and sometimes people put
wildcards as entries to allow them to create subdomains instantly and then
remove them later.

These removed ones or misspelt subdomains (or anything for that matter) are
forwarded to the first subdomain that I created on that ip on the box. I
don't know if people encounter this and have found a solution?

 

I tried a mod_rewrite script to allow me to strip out the subdomain, and put
"www" infront to the domain the user has entered into the url bar and then
forward, but unfrourtunately for my .co.uk/me.uk it removes the uk part 

effectively pointing to a co which is a different tld

 

>From reading various websites this is what I came up with, but its probably
wrong, or badly written

 

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www.)?([^.]+).(.*)\.(.*)\.(.*) [NC]

RewriteCond %2 !^www$ [NC]

RewriteRule ^(.*)$ http://%3.%4/$1 [QSA,L]

 

I tried php too but since I don't program it didn't end up well

 

Any help would be much appreciated

 

And on a side note, what does the "Modify SOA" do and does it benefit me, I
know it's a dumb question. I don't use the DNS functionality on the box (I
use the registrars) , as I found it to cause me loads of problems.

 

 

Regards,

 

 

Germano 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.blueonyx.it/pipermail/blueonyx/attachments/20101215/fb017e69/attachment.html>


More information about the Blueonyx mailing list