PDA

View Full Version : Trouble with root pointers and hosting multiple sites in one account


richleah
11-17-2008, 02:16 AM
I have a page at the site rootcalled home.asp. That page has the following script in it:

<%
If InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("sitea.com") ) > 0 Then
Response.Redirect("/sitea")
ElseIf InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("siteb.com") ) > 0 Then
Response.Redirect("/siteb")
Else
Response.Redirect("/sitea")
End If
%>


The script is working great and redirecting to the appropriate subfolder. I have both subfolders marked as .net applications. The problem I am having is that when you go to either domain you also see the subfolder name in the url:

www.sitea.com (http://www.sitea.com) yeilds ==> www.sitea.com/sitea/default.aspx (http://www.sitea.com/sitea/default.aspx)

Basically, the application is looking back to the root folder as the application root instead of looking at the subfolder as the application root. Am I missing a setting in the web.config or something? I am not used to setting up application folders within application folders so this may be a knowledge gap for me. By the way, I do still have an application installed at the root folder level, but with the home.asp file redirecting, that application should not be working.

Any help would be appreciated!!

Richard

Spock
11-20-2008, 04:27 AM
The only way not to see the path is to do Url Rewriting.
Go to Asp.net and search - there are several posts on this.


Thank you,

Spock

Visual Studio 2005
ASP.NET 2.0
WinXP SP2

richleah
11-20-2008, 06:44 AM
Thanks so much for the help. I have been doing some research and was coming to that conclusion. Thanks again!!

richleah
11-28-2008, 03:02 AM
MacMan, I found this http://www.urlrewriting.net/149/en/home.html. I have not tried it, but it looked like it would work for us. I would love to hear if some is using it.

andrewdiscountasp
11-28-2008, 12:49 PM
can anyone give some guidance or code examples on how we can do this on discountasp.net.
THis is the last thing I'd like to get working.. http://community.discountasp.net/emoticons/smile.gif
I've been with DASP for 2 years and the service is great (plug http://community.discountasp.net/emoticons/smilewinkgrin.gif )