Silex .htaccess 403错误

时间:2017-06-16 16:45:58

标签: php .htaccess silex

我的Silex API上出现了403禁止错误。

以下是我的项目的架构:architecture

这是我的问题;

在/web/index.php中,我有一个显示欢迎消息的get路由。我可以通过调用example.com/api/2.0/web/来阅读此消息,但不能使用example.com/api/2.0/(这是我想要做的)。

我有一个.htaccess文件,应该将我从根目录重定向到/2.0/web/index.php,但它似乎不起作用。

这是我的.htaccess文件

<IfModule mod_rewrite.c>
Options -MultiViews

RewriteEngine On
RewriteBase /web
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)/$ index.php [QSA,L]
</IfModule>

我在/ web目录中有另一个.htaccess文件

<IfModule mod_rewrite.c>
Options -MultiViews

RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

谢谢大家的帮助!

0 个答案:

没有答案