使用目录中的PHP路由器

使用目录中的PHP路由器,php,url-rewriting,fat-free-framework,Php,Url Rewriting,Fat Free Framework,我有一个安装了apache的专用服务器 我在不同的文件夹中有不同的网站,我可以这样访问: www.example.com/folder1 www.example.com/folder2 但在文件中,我使用框架(F3)。 当我尝试像www.example.com/f3/my/route这样的东西时,路由器会产生404错误 如何在不创建别名的情况下更改此选项 请参见my/f3/.htaccess: # Enable rewrite engine and route requests to fram

我有一个安装了apache的专用服务器

我在不同的文件夹中有不同的网站,我可以这样访问: www.example.com/folder1 www.example.com/folder2

但在文件中,我使用框架(F3)。 当我尝试像www.example.com/f3/my/route这样的东西时,路由器会产生404错误 如何在不创建别名的情况下更改此选项

请参见my/f3/.htaccess:

# Enable rewrite engine and route requests to framework
RewriteEngine On

# Some servers require you to specify the `RewriteBase` directive
# In such cases, it should be the path (relative to the document root)
# containing this .htaccess file
#

RewriteBase /f3/

RewriteCond %{REQUEST_URI} \.ini$
RewriteRule \.ini$ - [R=404]

RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L,QSA]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
谢谢


Romain

在.htacces文件中,添加一个具有文件夹名称的rewritebase:

RewriteBase /f3/

@4z3rty好的,那么你需要显示一些代码,其他的只是猜测。我已经在我的帖子中添加了我的.htaccess。好的,看起来不错,但是可能还有很多其他错误。如果从webroot运行,比如example.com(不是子文件夹),代码是否正常?如果不是,则文件夹为未更新否,f3位于默认文件夹(/var/www/f3)中。我用一个别名开发,我的路由工作了…我编辑了我的apache配置,将AllowOverride None更改为AllowOverride All,它工作了!