By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,738 Members | 1,080 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,738 IT Pros & Developers. It's quick & easy.

Subdomains

P: n/a
I just got my own domain at dardel.info
My host allows me to create subdomains.
Let's assume I have created music.dardel.info
On my computer, the files are in a folder of my site: mySite/music (or
\music for the PC guys).
If I have a file (assume style.css) in the main folder, how can I link
it for the pages in my subdomain?
it seems that
<LINK REL=STYLESHEET HREF="../style.css" TYPE="text/css">
does not work. Must I put the _absolute_ reference in the files of my
subdomain:
<LINK REL=STYLESHEET HREF="HTTP://dardel.info/style.css" TYPE="text/css"?

--
François de Dardel
http://dardel.info/
Faber est suae quisque fortunae
Enlever le quatorze pour m'écrire
Remove fourteen in the address to send mail

Jan 28 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Rik
François de Dardel <da*******@noos.frwrote:
I just got my own domain at dardel.info
My host allows me to create subdomains.
Let's assume I have created music.dardel.info
On my computer, the files are in a folder of my site: mySite/music (or
\music for the PC guys).
If I have a file (assume style.css) in the main folder, how can I link
it for the pages in my subdomain?
it seems that
<LINK REL=STYLESHEET HREF="../style.css" TYPE="text/css">
does not work. Must I put the _absolute_ reference in the files of my
subdomain:
<LINK REL=STYLESHEET HREF="HTTP://dardel.info/style.css"
TYPE="text/css"?
Yes, another domain, and a stylesheet outside it's document root would
require an absolute reference.

http://music.dardel.info/../ doesn't make sense, and isn't accessable to
the visitor.
--
Rik Wasmus
Jan 28 '07 #2

P: n/a
..oO(François de Dardel)
>I just got my own domain at dardel.info
My host allows me to create subdomains.
Let's assume I have created music.dardel.info
On my computer, the files are in a folder of my site: mySite/music (or
\music for the PC guys).
That's just one way of setting up a subdomain, there are others. In fact
the above is a rather bad one, since it allows to access the subdomain's
content with a URL relative to the main site:

http://music.dardel.info vs. http://dardel.info/music

The latter might lead to unexpected results. If possible the document
root of the subdomain should be placed _outside_ of the main site's
document root. Then both sites will be completely separated, as it
should be.
>If I have a file (assume style.css) in the main folder, how can I link
it for the pages in my subdomain?
it seems that
<LINK REL=STYLESHEET HREF="../style.css" TYPE="text/css">
does not work. Must I put the _absolute_ reference in the files of my
subdomain:
<LINK REL=STYLESHEET HREF="HTTP://dardel.info/style.css" TYPE="text/css"?
Yes. From a browser's POV a subdomain is a completely different server.
To access such resources you always have to use an absolute URL.

Micha
Jan 28 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.