开发者

ASP.NET MVC2 - Isolate subfolder for using PHP

开发者 https://www.devze.com 2023-01-02 00:34 出处:网络
I would like to have domain.com using asp.net mvc2 technology and domain.com/blog woul开发者_运维问答d use php. Is it possible to do this on server and to isolate this folder to use php? I know that i

I would like to have domain.com using asp.net mvc2 technology and domain.com/blog woul开发者_运维问答d use php. Is it possible to do this on server and to isolate this folder to use php? I know that it is much easier with subdomain (blog.domain.com) but I'm interested in subfolder solution.


Subfolders shouldn't be an issue. IIS will check for an existing file/folder before it gets to MVC, so placing a /blog folder with your content in should work just fine. The thing to be wary of is if you want to use /blog in any of your routes, as these will fail because of the existing /blog folder, likely resulting in a 404.

If you are finding that it is not working for any reason, try registering an ignored route:

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

That will stop MVC from processing any urls with blog/ in it.

0

精彩评论

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