开发者

Deploy mvc.net on none root IIS app folder

The title may be a little unclear, but I didn't know how to describe it otherwise. The problem is the following:

I have an mvc website and 2 servers, a testing server and the real server. the problem is: the testing ser开发者_JS百科ver folder is a root folder, so the adress is:

http://www.testingserver.com/ -> this poses no problem.

but now I have to deploy to the life server which is:

http://www.realserver.com/myappfolder/ ->this is a problem.

this is a problem because the routing does not work this way, it does:

http://www.realserver.com/{controller}/... instead off http://www.realserver.com/myappfolder/{controller}

Is ther a valid way to solve this problem ?


Did you make myappfolder a virtual directory? Do you have the ability to (do you have full control, or is this a shared hoster)?

EDIT: You should be able to change your default route to include myappfolder in the route URL... so change the default "/{controller}/{action}.." to "/myappfolder/{controller}/{action}..".


Ok,

I just wrote an ignorerule in the routing in global asax, for now the problems are solved :)

example:

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");


It is very strange the routing is working like that for you. Are you using Url.Action to create those urls or are you just doing '/{Controller}/Action'?
You should always use Url.Action and Url.Content for urls in your html if you want to avoid problems when deploying to a different root directory

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜