【发布时间】:2014-11-15 13:44:20
【问题描述】:
我有一个管理路由的 Marionette 应用程序,但我不希望它为对 server.com/api/anything/at/all 的 api 调用请求处理它们
我的规则现在看起来像这样,但 Marionette 似乎总是能抓住它,即使是 /api/*
# ------------------------------------------------------------------------------
# | Marionette |
# | If it's not for /api/*, then handle it |
# ------------------------------------------------------------------------------
<ifModule mod_rewrite.c>
DirectorySlash Off
RewriteEngine On
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteCond %{REQUEST_URI} !^/api/ [NC]
RewriteRule ^(.*)index.php $1 [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteRule (.*) index.php
</ifModule>
# ------------------------------------------------------------------------------
# | Phalcon |
# | If it fell through, handle with Phalcon |
# ------------------------------------------------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
</IfModule>
谁能告诉我我在这里做错了什么吗?谢谢。
编辑:如果它给出任何清晰,上面的 .htaccess 在我的 /public 文件夹中。在我的根文件夹中:
# ------------------------------------------------------------------------------
# | Phalcon |
# ------------------------------------------------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
</IfModule>
公共重写工作正常。我只是想我会分享它,以防它在公共场合影响到我没有想到的那个。谢谢!
【问题讨论】:
标签: apache .htaccess mod-rewrite marionette phalcon