KatieK
KatieK

Reputation: 13853

How to go up one sub-domain in a relative URL?

From a page at cupcakes.dessert.mysite.com/, how can I use a relative URL to access images or a style-sheet from dessert.mysite.com/? Is there a way to specify "back one sub-domain" in URIs?

I don't want to use an absolute URL such as src="http://dessert.mysite.com/images/bg.gif" because that approach would require a different absolute URL for salad.mysite.com, as well as possibly overriding an HTTPS connection.

Upvotes: 1

Views: 435

Answers (1)

SLaks
SLaks

Reputation: 887433

That is not possible.

To address your second concern, use a protocol-relative URL:

src="//dessert.mysite.com/images/bg.gif"

Upvotes: 3

Related Questions