我有这个正则表达式
^([^\.]+)\.aspx$
仅匹配以下
FolPage.aspx
~/FolPage.aspx
~/Folder/FolPage.aspx
~/Folder/Folder1/Folder2/FolPage.aspx
~/Folder/Folder1/Folder2/Folder3/Folder4/FolPage.aspx
我想要一个与上面的url匹配的正则表达式以及Url'
下面的正则表达式../FolPage.aspx
../Folder/FolPage.aspx
../Folder/Folder1/Folder2/FolPage.aspx
../Folder/Folder1/Folder2/Folder3/Folder4/FolPage.aspx
您可以看到演示 Here..!!
其实我正在尝试进行网址重写..
<rewrite>
<rules>
<rule name="Redirect" stopProcessing="true">
<match url="^([^\.]+)\.aspx$" />
<conditions>
<add input="{REQUEST_METHOD}" negate="true" pattern="^POST$" />
</conditions>
<action type="Redirect" url="{ToLower:{R:1}}/" appendQueryString="false" redirectType="Permanent" />
</rule>
<rule name="Rewrite" stopProcessing="true">
<match url="^([^/]+)/$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="{R:1}.aspx" />
</rule>
</rules>
</rewrite>
我需要正则表达式重定向和重写
答案 0 :(得分:1)
答案 1 :(得分:1)
答案 2 :(得分:0)
你可以尝试这个:
^(?:\.\.|[^\.])+\.aspx$
这意味着..
或not .
答案 3 :(得分:0)
试试这个正则表达式:
^(\.{2}|~)?.+\.aspx$
http://rubular.com/r/UPoFog0Abj