.htaccess 用动态脚本重写?
我在 Windows/IIS Web 服务器上使用 HeliconTech ModRewrite v3 通过 .htaccess 文件进行重写。
我有一个数据库表,其中包含文件名和 ID,并且希望使用这个不断变化的列表重写传入的 url。
通常,如果使用地图/列表,我使用以下代码:
#RewriteRule ^content/(.+)\.asp$ default.asp?ID=${map:$1} [L,NC]
将 *content/some_site.asp* 更改为 default.asp?id=123
是否可以动态填充映射文件,例如通过 php 或 asp 脚本?
i use the HeliconTech ModRewrite v3 on an Windows/IIS Webserver to make rewrites via an .htaccess File.
i have a db-Table with filename's to id's and want to a rewrite incoming urls with this constantly changing list.
Normaly, if using a map/list i use this code:
#RewriteRule ^content/(.+)\.asp$ default.asp?ID=${map:$1} [L,NC]
With makes *content/some_site.asp* to default.asp?id=123
Is it possible to fill the mapping file dynamic, e.g. via php or asp script?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用的是 IIS 7,则可以使用 Helicon Ape 代替。它与 ISAPI_Rewrite 3 兼容并且支持数据库映射。
Helicon Ape 数据库功能介绍
< a href="http://www.helicontech.com/articles/tag/mod_dbd/" rel="nofollow">mod_dbd 广告
If you are on IIS 7 then you can use Helicon Ape instead. It is compatible with ISAPI_Rewrite 3 and it supports database maps.
Introduction to database functionality of Helicon Ape
mod_dbd adticles
不幸的是,ISAPI_Rewrite v3 不支持 prg: 类型的映射:请参阅 Apache mod_rewrite 兼容性页面了解确切的详细信息。
Unfortunately not -- ISAPI_Rewrite v3 does not support prg: type of mapping: see the Apache mod_rewrite compatibility page for exact details.