如何从 htaccess 中的默认路由中排除 api.php
我使用 Zend 提供的默认 .httaccess。我在 apache 配置中定义了另一条路由,以便提交到 /api.php/WHATEVER 的所有内容都被路由到另一个框架。
如果我将默认路由添加到 .htaccess 文件中,则该规则将被覆盖。我尝试禁用重写引擎的方法如下:
RewriteEngine On
# api.php
RewriteCond %{REQUEST_URI} !^/(api\.php/.*)$
# Existing file
RewriteCond %{REQUEST_FILENAME} -s [OR]
# Existing directory
RewriteCond %{REQUEST_FILENAME} -l [OR]
# Symbolic link
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
不幸的是,我没有看到错误。感谢您的帮助。
I use the default .httaccess provided by Zend. I have another route defined in my apache configs so that everything submitted to /api.php/WHATEVER is being routed to another framework.
If I add the default routes into the .htaccess file, this rule is being overwritten. What I tried to do to disable the rewrite engine was the following:
RewriteEngine On
# api.php
RewriteCond %{REQUEST_URI} !^/(api\.php/.*)$
# Existing file
RewriteCond %{REQUEST_FILENAME} -s [OR]
# Existing directory
RewriteCond %{REQUEST_FILENAME} -l [OR]
# Symbolic link
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
Unfortunately, I don't see the error. Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许这应该有效:
但你可以适应......
Maybe this should work :
but you may adapt...