[BlueOnyx:06133] Re: wildcard domains and mod_rewrite

James Darbyshire jamesdarbyshire at gmail.com
Wed Dec 15 17:06:11 -05 2010


Hi Germano,

Often it is considered 'best practise' to create a *.domain.com as this
ensures that all traffic to your store is caught.

Regards,

James Darbyshire

Sent from my Samsung Droid™

On 16/12/2010 8:50 AM, "Germano Soru" <germano at soru.me.uk> wrote:

 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* <http://www.mailscanner.info/>, and is
believed to be clean.

_______________________________________________
Blueonyx mailing list
Blueonyx at blueonyx.it
http://www.blueonyx.it/mailman/listinfo/blueonyx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.blueonyx.it/pipermail/blueonyx/attachments/20101216/a21ec4a3/attachment.html>


More information about the Blueonyx mailing list