[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Re: subdomains



> Hello cobalt-users,
>
> >Of course make an 'A' record in domain.com zone
> >for 123
> >123  IN  A  IP of domain.com
>
> This dont work.
>
> I enter 123.domain.com and give the IP-Adress.
> But where should I enter the directory to land if this is entered?
>
> I am the owner of the RAQ and can do all settings.
>

I always put www.123 as an 'a' record also so that,
http://www.123.domain.com and
http://123.domain.com are good URL

Put a record in httpd.conf: (or in an include file)

<VirtualHost ip.add.re.ss>
ServerName www.123.domain.com
ServerAdmin 123user
ServerAlias 123.domain.com
DocumentRoot /home/sites/siteNN/users/123/web
RewriteEngine on
RewriteCond %{HTTP_HOST}             !^ip.add.re.ss(:80)?$
RewriteCond %{HTTP_HOST}             !^www.123.domain.com(:80)?$
#RewriteRule ^/(.*)                   http://www.123.domain.com/$1 [L,R]
RewriteOptions inherit
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
</VirtualHost>

note use this line if you want the browser to always say www.
#RewriteRule ^/(.*)                   http://www.123.domain.com/$1 [L,R]
else it will say http://123.domain.com when called that way.

I also put the above virtual host record in an include file, "say
mysubdomains.conf"
I put this file in /etc/httpd

Then just below the main site in httpd.conf put
include mysubdomains.conf