【发布时间】:2018-06-06 10:13:26
【问题描述】:
我有网站
http://example.com/school/student.cfm?id=100
另外,我还有另一个链接http://example.com/collage/student.cfm?id=200
我想写一个 URL 重写规则,它总是重写 http://example.com/school/student.cfm?id=100
给http://example.com/school/student/100
和
http://example.com/collage/student.cfm?id=200
给http://example.com/collage/student/200
我已经写了这样的规则,但总是使用 1 个目录,但我希望这适用于所有目录。
<rule name="Redirect to school with ONE parameter" 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="school/student.cfm?id_Name={R:1}" />
</rule>
【问题讨论】:
标签: mod-rewrite iis coldfusion