【发布时间】:2015-11-17 22:29:40
【问题描述】:
我有一个使用 handlebar.js 模板的静态 SPA 类网站。它适用于具有以下 URL 重写规则的 IIS,但我需要将其移动到使用 .htaccess 的服务器。我不确定如何将以下 URL 重写规则转换为 .htaccess 重写规则:
<system.webServer>
<rewrite>
<rules>
<rule name="RewriteUserFriendlyURL1" stopProcessing="true">
<match url="^([^/]+)/([^/]+).html" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.html?category={R:1}&page={R:2}" />
</rule>
</rules>
</rewrite>
</system.webServer>
【问题讨论】:
标签: apache .htaccess mod-rewrite url-rewriting