ASP.NET HTT predirect:重定向除一人外的所有页面

编程入门 行业动态 更新时间:2024-10-26 00:28:18
本文介绍了ASP.NET HTT predirect:重定向除一人外的所有页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用在web.config此code在我的网站上的一个文件夹中的所有页面重定向到根,因为我要永久结束本节。

I use this code in the web.config in one of the folders of my website to redirect all pages to the root because I want to close permanently this section.

<?xml version="1.0" encoding="utf-8"?> <configuration> <location> <system.webServer> <httpRedirect enabled="true" destination="www.example/" httpResponseStatus="Permanent" /> </system.webServer> </location> </configuration>

但我需要作出例外:我不希望我的页面的Default.aspx要重定向。我该怎么做?

But I need to make an exception to this rule : I don't want my page "default.aspx" to be redirect. How can I do that?

感谢你在前进!

推荐答案

您可以通过以下方式添加通配符,重定向只有某些文件:

you can add a wildcard in the following manner, to redirect only certain files:

<configuration> <system.webServer> <httpRedirect enabled="true" exactDestination="true" httpResponseStatus="Found"> <add wildcard="*.php" destination="/default.htm" /> </httpRedirect> </system.webServer> </configuration>

但我不知道如果你能否定这一点,所以它忽略某个特定文件。

But i'm not sure if you can negate that, so that it ignores a certain file.

更多推荐

ASP.NET HTT predirect:重定向除一人外的所有页面

本文发布于:2023-11-01 22:58:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550657.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:一人   重定向   页面   NET   ASP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!