My subdomain .NET project is not directing to my startup file - asp.net

My wedding is coming up and I've printed 100 invites directing my guests to http://wedding.mydomain.com. Similar to a stand-alone project, I've set my startup page to my Default.aspx page as demonstrated here: http://blogs.msdn.com/b/zainnab/archive/2010/12/16/set-as-start-page-vstipproj0027.aspx.
However, when directed toward http://wedding.mydomain.com, I get a 'Maintenance' page. I have to manually go to http://wedding.mydomain.com/Default.aspx, to get the desired project.

Sounds like you might need to set the default document.
If you have an using IIS7(+) windows hosting you can set the default document in your web.config like
<configuration>
<system.webServer>
<defaultDocument enabled="true">
<files>
<add value="default.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
If you are using the Plesk interface refer to this article: https://support.godaddy.com/help/article/6853/changing-your-windows-hosting-accounts-default-file

Related

Default page at end of url

my test site suddenly went weird after I added condition for letting %20 at end of urls pass thru, example:
localhost/MySite/1234%20
redirects to
localhost/MySite/1234
it was okay, when I was testing it in my local pc, but upon deployment for testing, it redirects to this link
localhost/MySite/1234/default.html
what do you think may cause this problem? also, "default.html" is my default page when accessing localhost/MySite
it goes to localhost/MySite/default.html
Are you using iis? it seems your webserver configuration in your local machine different from your deploying server. Maybe your testing server uses "default page" rule to default.html, something like this
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="Pages/default.html" />
</files>
</defaultDocument>
</system.webServer>
on your web.config.
try here http://www.iis.net/configreference/system.webserver/defaultdocument

Windows Azure and web.config settings

I'm new to Windows Azure and just created my first "Web Site". Very easy and running well. 1 question though...
Does Azure ignore and/or override some or all settings that I have configured in my web.config file?
As a simple example, I have the following in my web.config:
<system.webServer>
<defaultDocument enabled="true">
<files>
<clear />
<add value="index.html" />
</files>
</defaultDocument>
</system.webServer>
But I still see many possible default documents listed on the Configure tab for my site.
It got me wondering what other settings it is ignoring.
Thanks.
If you have a <clear/> line, I would not expect any of the default docs that you see in the Azure portal to actually be effective. What the Azure portal shows is what ends up going in ApplicationHost.config, which your web.config overrides.
Are you saying that you still see the Azure portal values being effective at runtime? That would be puzzling.
IIS in Windows lists several common default documents when you manage a site(home.html, index.php, etc). What you have listed in your web.config is not the list of possible default documents, it is the exact default document for your application. Azure is showing you common default documents in the configuration manager and will override your web.config if you choose something different.

Setting default page in iis7

I have a web application which is hosted in iis7 in amazon ec2 instance.The directory structure is like Website>Pages>welcome.aspx.The physical path for the iis site has been set at website level.I have added the default page as pages/welcome.aspx.Now when we are accessing the website the site redirects to the default page but the url remains like abc.com:XXXX rather than abc.com:XXXX/pages/welcome.aspx.Now when someone clicks on links with href like abcd.aspx, a page not found exception is thrown as it is searching for the content in the root directory rather than in the pages directory.
Go to your web.config and add:
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="pages/welcome.aspx" />
</files>
</defaultDocument>
</system.webServer>
From this post.

Modifications in default document won't take effect

We have a website developed by ASP.NET+IIS7 and its default document is default.aspx. It works fine. But when we tried to switch the default to index.html, weird things happened.
We have modified web.config as follows:
<defaultDocument>
<files>
<clear />
<add value="index.html" />
</files>
</defaultDocument>
and we have clear everything under C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files``, and restart the worker process. We even changed the name of Default.aspx to dddd.aspx.
But everything stays the same when accessing with http://localhost/<MyAppName>/!
And when we tried to access with http://localhost/<MyAppName>/index.html, it works fine.
Any suggestions would be highly appreciated.
You have to change your IIS Website Settings. The order in which the documents will be served.
You problably have
Default.aspx
Index.html
It should be
Index.html
Default.aspx

ASP.NET Authentication with Roles in IIS7 Integrated Mode for Static Content

I am experimenting with the integrated authentication mode for static content in IIS7. I followed the instructions in this article: https://web.archive.org/web/20210612113955/https://aspnet.4guysfromrolla.com/articles/122408-1.aspx
It is working fine if I allow/deny access by login status (like in the article). However I want to allow/deny access based on roles (using the ASP.NET built in Roles Provider). When I put an allow rule for the role "Admin" in the web.config and deny rule for all other users I am not able to access the static files even when I login as an admin. The same folder contains non-static content (aspx pages) that are accessed just fine based on the Role Provider information.
Any ideas?
Try adding the following to your <system.webServer> <modules> block:
<configuration>
<system.webServer>
<modules>
<remove name="FormsAuthentication" />
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
<remove name="UrlAuthorization" />
<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" />
<remove name="DefaultAuthentication" />
<add name="DefaultAuthentication" type="System.Web.Security.DefaultAuthenticationModule" />
<remove name="RoleManager" />
<add name="RoleManager" type="System.Web.Security.RoleManagerModule" />
</modules>
</system.webServer>
</configuration>
The RoleManager bit is key, and it's not included in any of the online examples that I could find. Without that, the user's role membership isn't initialized for static content, so role-based authorization will always fail.
(Disclaimer: I've pieced this together myself based on my limited understanding of IIS, but it seems to work.)
Edit (in response to your comment): Sorry, I don't know much about how RoleManager depends on other modules. You can view the default IIS configuration by looking at c:\Windows\System32\inetsrv\config\applicationHost.config (at least, that's the past on my Windows Vista machine) to see the order in which modules are loaded (note the use of managedHandler by default to restrict RoleManager to non-static content), and MSDN covers RoleManagerModule along with the rest of the modules in the System.Web.Security namespace, so you could probably find what you need there.
I would say the most likely culprit is that the static files are not being processed by ASP.NET but being left up to IIS.
Does it work if you add a wildcard script mapping?

Resources