简体   繁体   English

如何从 ASP.NET MVC 中排除 WordPress 博客文件夹

[英]How to exclude WordPress blog folder from ASP.NET MVC

I have a website, let's say x.com and on it I have a subdomain called blog.x.com .我有一个网站,比如说x.com ,在上面我有一个名为blog.x.com的子域。 This subdomain hosts a WordPress blog engine.此子域托管 WordPress 博客引擎。 Now because of SEO I want to move blog.x.com to x.com/blog .现在因为 SEO 我想将blog.x.com移动到x.com/blog

The point is, my application is ASP.NET MVC and I want to exclude /blog and every subdirectory URL of it from ASP.NET MVC and return the processing back to IIS and static file handler. The point is, my application is ASP.NET MVC and I want to exclude /blog and every subdirectory URL of it from ASP.NET MVC and return the processing back to IIS and static file handler.

This is what I've done in Web.config file:这是我在Web.config文件中所做的:

  <system.webServer>
    <handlers>
      <add path="/blog/*" verb="*" modules="StaticFileModule" name="WordPress"/>
    </handlers>
  </system.webServer>

The point is, now all URLs to x.com/blog/* return empty result.关键是,现在所有指向x.com/blog/*的 URL 都返回空结果。 It does not return 404, which means some level of configuration has happened.它没有返回 404,这意味着已经发生了某种级别的配置。 But it doesn't return static HTML or image files in that directory either.但它也不会返回 static HTML 或该目录中的图像文件。

What should I do?我应该怎么办?

I have a website, let's say x.com and on it I have a subdomain called blog.x.com .我有一个网站,比如说x.com ,在上面我有一个名为blog.x.com的子域。 This subdomain hosts a WordPress blog engine.此子域托管 WordPress 博客引擎。 Now because of SEO I want to move blog.x.com to x.com/blog .现在因为 SEO 我想将blog.x.com移动到x.com/blog

The point is, my application is ASP.NET MVC and I want to exclude /blog and every subdirectory URL of it from ASP.NET MVC and return the processing back to IIS and static file handler. The point is, my application is ASP.NET MVC and I want to exclude /blog and every subdirectory URL of it from ASP.NET MVC and return the processing back to IIS and static file handler.

This is what I've done in Web.config file:这是我在Web.config文件中所做的:

  <system.webServer>
    <handlers>
      <add path="/blog/*" verb="*" modules="StaticFileModule" name="WordPress"/>
    </handlers>
  </system.webServer>

The point is, now all URLs to x.com/blog/* return empty result.关键是,现在所有指向x.com/blog/*的 URL 都返回空结果。 It does not return 404, which means some level of configuration has happened.它没有返回 404,这意味着已经发生了某种级别的配置。 But it doesn't return static HTML or image files in that directory either.但它也不会返回 static HTML 或该目录中的图像文件。

What should I do?我应该怎么办?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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