[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cobalt-users] not using "www"
- Subject: RE: [cobalt-users] not using "www"
- From: "Kai" <go@xxxxxxxxxxxx>
- Date: Fri Mar 22 00:50:32 2002
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
Wildcarded DNS is fun and easy.
Step 1: [root@yourbox]pico /etc/named/records
Find the domain you want to be wildcarded. Eg: dave.com
a - dave.com 000.000.000.000
Step2: add a second line below this entry:
a * dave.com 000.000.000.000
Then save and exit records.
Step3: [root@yourbox]pico /etc/named/pri.dave.com
You will see a list of a-record entries. Add this line somewhere in there:
*.dave.com. in a 000.000.000.000
Then save and exit pri.dave.com
Step4: [root@yourbox]pico /etc/httpd/conf/httpd.conf
Find the dave.com virtual host.
Find the Rewrite lines. Eg:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^000.000.000.000(:80)?$
RewriteCond %{HTTP_HOST} !^www.dave.com(:80)?$
RewriteRule ^/(.*) http://www.dave.com/$1 [L,R]
RewriteOptions inherit
Now.
Remove the exclamation mark in front of the two conditions. So you have:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^000.000.000.000(:80)?$
RewriteCond %{HTTP_HOST} ^www.dave.com(:80)?$
RewriteRule ^/(.*) http://www.dave.com/$1 [L,R]
RewriteOptions inherit
Save httpd.conf and exit.
Step6:
[root@yourbox] /etc/rc.d/init.d/./named restart
once that completes then:
[root@yourbox] /etc/rc.d/init.d/./httpd restart
THAT'S IT!!!!
Now you might want a subdomain. Just add under the rewrite section:
RewriteCond %{HTTP_HOST} [^.]*\subdomain.dave.com$
RewriteRule ^(.*)$ /home/sites/siteN/web/anydiryouwant$1
Worked on my RaQ4.
Ciao.
Kai.
-----Original Message-----
From: cobalt-users-admin@xxxxxxxxxxxxxxx
[mailto:cobalt-users-admin@xxxxxxxxxxxxxxx]On Behalf Of hexy
Sent: Friday, 22 March 2002 3:35 AM
To: cobalt-users@xxxxxxxxxxxxxxx
Subject: RE: [cobalt-users] not using "www"
What about some wildcards? something like this:
--snip--
RewriteEngine on
RewriteCond %{HTTP_HOST} !^000.000.000.000(:80)?$
RewriteCond %{HTTP_HOST} !^www.yourdomain.com(:80)?$
RewriteCond %{HTTP_HOST} !^(.*)yourdomain.com(:80)?$
RewriteRule ^/(.*) http://www.yourdomain.com/$1 [L,R]
RewriteOptions inherit
--snap--
I don;t know what effect that would have on name based virtual hosts tho,
probably have to specify each severalias that you want...
Rgds
Dave Transom
-----Original Message-----
From: "Kai" <go@xxxxxxxxxxxx>
To: <cobalt-users@xxxxxxxxxxxxxxx>
Subject: RE: [cobalt-users] not using "www"
Date: Thu, 21 Mar 2002 20:24:52 +1000
Reply-To: cobalt-users@xxxxxxxxxxxxxxx
Yep sure is.
[root@yourbox]# pico /etc/httpd/conf/httpd.conf
save it as httpd.conf.backup<date> ( the way i do it ) just in case
scroll down to the virtual site you want.
IE:
<VirtualHost 000.000.000.000>
ServerName www.yourdomain.com
ServerAdmin admin
DocumentRoot /home/sites/siteXX/web
ServerAlias yourdomain.com
RewriteEngine on
RewriteCond %{HTTP_HOST} !^000.000.000.000(:80)?$
RewriteCond %{HTTP_HOST} !^www.yourdomain.com(:80)?$
RewriteRule ^/(.*) http://www.yourdomain.com/$1 [L,R]
RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/siteXX/users/$1/web/$3
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
AddHandler server-parsed .shtml
AddType text/html .shtml
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php
# AddHandler chiliasp .asp
# AddHandler chiliasp .asa
</VirtualHost>
OK see this bit:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^000.000.000.000(:80)?$
RewriteCond %{HTTP_HOST} !^www.yourdomain.com(:80)?$
RewriteRule ^/(.*) http://www.yourdomain.com/$1 [L,R]
RewriteOptions inherit
Change this line:
RewriteCond %{HTTP_HOST} !^www.yourdomain.com(:80)?$
To:
RewriteCond %{HTTP_HOST} ^www.yourdomain.com(:80)?$
Save it. And restart httpd by typing: /etc/rc.d/init.d/./httpd restart
This worked for me. RaQ4. Might be different for you.
Kai.
-----Original Message-----
From: cobalt-users-admin@xxxxxxxxxxxxxxx
[mailto:cobalt-users-admin@xxxxxxxxxxxxxxx]On Behalf Of Benedict
Sent: Thursday, 21 March 2002 4:55 AM
To: cobalt-users@xxxxxxxxxxxxxxx
Subject: [cobalt-users] not using "www"
Hi
I've been discussing the use of "www" in front of some
of the domain-names I maintain. Is there a way
to make Cobalt machines (RaQ 4 and Qube 3 in my case)
*not* jump to setting a hostname in front of the domain?
So that if I use
http://domain.org
that it doesn't change into
http://www.domain.org
all the time?
I'm not convinced the hosts are of use in my setups,
and I want my domains to enjoy their short names,
without the "www" in front of it.
In a BSD environment which I also maintain, the host
can be anything I want, or nothing at all, and the
DNS-records have no problem dealing with this.
http://domain.org does not need a host in front of it,
http://*.domain.org all goes to the same A-record.
Any tips on this highly appreciated,
------------------------------------------------
This mail sent from DHBiT - http://mail.dhbit.ca
Come get your free, secure 5MB mailbox today!
_______________________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To Subscribe or Unsubscribe, please go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users