Forum Moderators: buckworks & webwork

Message Too Old, No Replies

dns issue

         

jss_eng

10:48 pm on Oct 19, 2004 (gmt 0)

10+ Year Member



hello guys

iam new to dns

i just want to know if is possible to make dns point to a sub directory or sub domain of a certian ip address instead of pointing to the main directory (using ip)

Romeo

11:49 pm on Oct 19, 2004 (gmt 0)

10+ Year Member



Hi Jss,

"A" records in the DNS point to domains, where it does not matter what domain level.

An example:
example.com. IN A 10.1.2.3
www.example.com. IN A 10.1.2.3
other.example.com. IN A 10.99.99.99
another.other.example.com. IN A 10.1.2.3

So the names of lines 1,2,4 point to the same server 10.1.2.3, while the name in line 3 points to a different machine.

The DNS records always point to addresses, it is up to a virtual web server to do a mapping to a sub-directory.

HTH and regards,
R.

jss_eng

12:04 am on Oct 20, 2004 (gmt 0)

10+ Year Member



thanks Romeo for your help

so how can i configure apache server to map to a certain sub directory

Romeo

8:38 am on Oct 20, 2004 (gmt 0)

10+ Year Member



The mapping to a sub directory is done in the httpd.conf config file within a <VirtualHost ...> block, where you define the ServerName (= domain name as defined in the DNS) and the DocumentRoot (= subdirectory in the web server's file structure).
However, it is recommended to read the docs to get some basic understanding about configuring virtual hosting on an Apache web server, either [httpd.apache.org...] for Apache 1.3 or [httpd.apache.org...] for Apache 2.0

Regards,
R.

jss_eng

8:50 am on Oct 20, 2004 (gmt 0)

10+ Year Member



unfortunately i don't have access to httpd.conf
since i don't have a dedicated server

is there any way to do this mapping using .htaccess?

regards

Romeo

10:26 pm on Oct 25, 2004 (gmt 0)

10+ Year Member



Usually, this is a vhost definition, which is done in the server's config file, not in the .htaccess.
One special case: if you have a wildcard DNS entry *.example.com and a wildcard serveralias in the vhost definition, then you would see all subdomains and may rewrite them inside your .htaccess to let one subdomain point to a subdirectory.
Otherwise I fear you are lost and should talk you your hoster about this.

Regards,
R.