【发布时间】:2012-08-14 01:11:37
【问题描述】:
在一遍又一遍地阅读 Fuel PHP 的 Installation Instructions(我很喜欢)之后,我无法弄清楚如何在没有显示公共网址的情况下使应用程序工作 /,并且无需从 docroot 中移动燃料文件夹。 (所以它都是自包含的)。
我的设置是这样的:
/Users/AeroCross/Sites(这是 MAMP 加载所有文件的地方,即 localhost)
/Users/AeroCross/Sites/projects/mariocuba(这是 Fuel 应用的根目录)
包含:
mariocuba/
.htaccess
oil
fuel/
app/
core/
packages/
public/
.htaccess
mariocuba 文件夹内的.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /public
RewriteRule ^(/)?$ index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
public 文件夹内的 .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
如果我尝试加载应用程序 (/Users/AeroCross/Sites/projects/mariocuba/),则会出现此错误:
Not found.
The requested URL /public/index.php/ was not found on this server.
我不知道在这里做什么。
我知道这不是为那样工作而设计的,而且我知道这是不安全的,但这是出于开发和版本控制的目的。我可以做些什么(只需对文件系统进行最少的调整)来完成这项工作?
值得注意的是,我的config.php 文件配置了base_url = null 和index_file = null。
任何帮助表示赞赏!
【问题讨论】:
-
你能访问
http://your.domain.com/public/index.php吗? -
@JonLin 如果我这样做,我会得到燃料生成的 404 (like this)
-
那么这个
index.php文件应该在哪里? -
@JonLin 就在那里。就是这样:我不知道为什么我会收到 404,因为文件实际上就在那里。我猜这是某种路由/重写失败。
标签: php apache .htaccess fuelphp fuelphp-routing