从 mod_rewrite 到 isapi_rewrite
我有一个 Modx htaccess 文件,需要从 mod_rewrite
重写为 isapi_rewrite
2.
有人可以帮助我吗?对于 isapi_rewrite
2,需要更改以下几行:
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
RewriteRule .* - [F,L]
RewriteRule ^(manager|assets) - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
非常感谢。
I have a Modx htaccess file which needs to be rewritten from mod_rewrite
to isapi_rewrite
2.
Can someone please help me? The following lines need to be changed for isapi_rewrite
2:
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
RewriteRule .* - [F,L]
RewriteRule ^(manager|assets) - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我强烈建议使用 ISAPI_Rewrite v3 因为它具有 99% mod_rewrite 兼容语法(仅来自上面的配置)选项不起作用),而 ISAPI_Rewrite v2 不支持“RewriteCond %{REQUEST_FILENAME} !-f”和其他一些指令。
另外,如果您使用的是 IIS 7 (7.5),您可以使用 Helicon Ape,它实现了 30 多个 Apache 模块(包括 Windows 系统上的 mod_rewrite)。 Ape 将按原样支持上述配置,无需任何修改。
I would strongly recommend using ISAPI_Rewrite v3 as it has 99% mod_rewrite compatible syntax (from the above config only Options won't work) while ISAPI_Rewrite v2 doesn't support "RewriteCond %{REQUEST_FILENAME} !-f" and some other directives.
Also if you are on IIS 7 (7.5) you may use Helicon Ape which implements 30+ Apache modules (including mod_rewrite) on Windows systems. Ape will support the above config as is, without any modifications.