如何忽略包含“.php”扩展名的路由

问题描述 投票:0回答:2

我想忽略对我的服务器的所有 *.php 请求。

现在我可以忽略根目录上的 .php 请求了

routes.IgnoreRoute("{resource}.php");

如何忽略到处都有的请求,就像这样:

www.site.com/products/index.php
www.site.com/clients/africa/info.php
c# routes
2个回答
0
投票

根据this以下内容可以工作

routes.Ignore("{*allphp}", new {allphp=@".*\.php(/.*)?"});

-1
投票

你尝试过吗

routes.IgnoreRoute("*/{resource}.php");
© www.soinside.com 2019 - 2024. All rights reserved.