How do I make http://my.domain.com run my ASP.NET application at http://my.domain.com/virtualdir
I am having problems with my ASP.NET application to run my application. For example, when I type: http://my.domain.com/virtualdir or
http://my.domain.com/virtualdir/default.aspx
My application will start, but I cannot start ASP.NET when I type http://my.domain.com .
I have tried setting the default document to .aspx with no luck. I'm sure there is something obvious I am missing here.
source to share
If you have an app in a directory (app) called virtualdirectory
then your app url http://my.domain.com/virtualdirectory/
.
However, if you want to use http://my.domain.com/
as the start URL, you need
Method 1
Move everything from C:\Inetpub\wwwroot\virtualdirectory
toC:\Inetpub\wwwroot\
I only recommend this course of action if this is the only application you have, or if this is the main application.
Method 2
OR you can try changing home / root direcory
Method 3
OR you can create a file namedc:\inetpub\wwwroot\default.aspx
and paste this into
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="Portal.App.WebForm2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e) {
Server.Transfer("virtualdirectory/default.aspx");
// or
// Response.Redirect("http://my.domain.com/virtualdirectory/default.aspx");
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
source to share
your virtual address for your web app, so until it gets called it won't start. you can redirect http://my.domain.com to http://my.domain.com/virtualdir , so Default.aspx will be requested. But don't forget to set Default.aspx as the file can be sent to the main page
source to share