简体   繁体   中英

ASP.NET MVC Extension-Less URLS on Shared Hosting? (GoDaddy, etc.)

Is it possible to have extension-less URLs (ASP.NET MVC default) with shared hosting? I have seen some things to get GoDaddy working by including the .aspx extension in the Global.asax routing, however I don't want my URLs to include .aspx.

Yes, I have a couple sites that are currently hosted on GoDaddy shared w/ extensionless URLs in ASP.NET. You need to enable IIS7 integrated pipeline mode as you can't access wildcard mappings or add ISAPI filters on a shared box. Once that's turned on, you can route incoming (extensionless) URLs to .aspx or whatever else through an HTTP Module or via URLRewriter.NET or whatever else.

Good luck.

It sounds like they are using IIS6 (or IIS5 even), which means you'll have to ask them to make some changes to the server settings or install an ISAPI filter to get extensionless routing. I don't think that's going to happen, especially with GoDaddy, so you are better off looking for someone who offers IIS7 hosting.

Check this out.

http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx

This says how to do it in a hosted environment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM