I have a domain name: TestSite.com. I create several subdomains for this site and refer to them as first.TestSite.com, second.TestSite.com, etc.
How do I refer to TestSi
If you want to keep your relative links, you can use the base element.
[The base element's href] attribute specifies an absolute URI that acts as the base URI for resolving relative URIs.
So, add a base
element, specify the href
you'd like, and all the relative URIs on the page now use the URI you've specified as the base URI.
That's all you need. However, if you'd like to make things a little cleaner, you can pull that URI from the web.config using System.Configuration.ConfigurationManager.AppSettings
. Here's an aspx snippet:
" />
And the web.config:
This method allows you to affect many elements from one and its value can be driven from the web.config.