Default page at end of url - asp.net

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

Related

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

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

What can cause a default route to fail?

I installed a deployed and working website (Windows Server 2003, IIS 6) onto an AWS instance, however unless I append a route name, the IIS default webpage is returned. For example, www.mysite.com returns the IIS page, while www.mysite.com/Home brings up the website.
I tried adding a route:
routes.MapPageRoute("/", "Home", "~/Default.aspx");
but it had no effect. I tried to hack around it by suffixing the URL with "Home" in Application_BeginRequest (Globals.asax.cs) and redirecting it, but
I much prefer and would welcome a clean solution to this problem. I suspect the issue is rooted in the enhanced security of IIS 8.5, but am not expert enough to understand how and why.
AWS Versions:
Windows Server 2012 R2
IIS 8.5
Have you tried this?
<configuration>
<system.webServer>
<defaultDocument enabled="true">
<files>
<add value="home.html" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
http://www.iis.net/configreference/system.webserver/defaultdocument

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.

how to set start page on hosting server after uploading the asp.net site

i have uploaded my site on hosting server with name www.selectionfurnishing.com
but when i try to open any page i got an error that the site does not exits
when i try www.selectionfurnishing.com/default.aspx then it gives error that the page does not exits (404)
please tell me how can i solve this ....
Thanks
You say it's hosted? I would suggest contacting your hosting provider. I would imagine it's a config issue on their side.
If your server is running IIS7, you should be able to set the start page for your site in your web.config file:
<configuration>
<system.webServer>
<defaultDocument>
<files>
<add value="default.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>

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

Resources