• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

ASP.NET issue with domains outside of route directory

I have several domains registered to use on some webspace I have with 1and1 hosting.
The whole webspace has a route directory and the rest of the domains held in folders under this.
Deploying the first site to it's own subdirectory (which I have registered as the destination in the 1and1 control panel), I came up with an issue with the web.config folder which I was told needs to be in the root of the webspace and not the site subfolder alone. Doing this I now have an issue with the root path for for my files including  MasterPageFile="~/MasterPage.master" in my site.
I am looking for a solution across all subdomains where each can be managed with there own web.config file and that each hosted and registered subdirectory is recognised as the root for that site.


0
Simon Cripps
Asked:
Simon Cripps
1 Solution
 
Simon CrippsOwnerAuthor Commented:
What needs to happen is that the dafault.aspx page in the root directory have  a redirect script placed in it such as  
<%EnableSessionState=False

host = Request.ServerVariables("HTTP_HOST")

if host = "test.com" or host = "www.test.com" then
response.redirect("http://domain1.com/domain1/index.htm")

elseif host = "tranquilhome.com" or host = "www.tranquilhome.com" then
response.redirect("http://domain2.com/domain2/index.htm")

else
response.redirect("http://domain1.com/error.htm")

end if
%>

http://faq.oneandone.co.uk/scripting/asp_net/asp_net_2_0/1.html

Subsites web config files will take presidence over the root file.
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now