Phalcon 框架显示页面索引而不是应用程序
Phalcon framework displays index of page instead of application
我想使用 learn phalcon,所以我尝试在 ubuntu 上安装它。我做了教程中的所有事情,我可以在 phpinfo() 中看到 phalcon。我使用以下 htaccess 文件制作了类似于教程中的示例项目,但在键入 localhost/tutorial 时我只能看到 /tutorial 的索引,而不是 Hello!留言
#/tutorial/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule ((?s).*) public/ [L]
</IfModule>
#/tutorial/public/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^((?s).*)$ index.php?_url=/ [QSA,L]
</IfModule>
尝试从您的 .htaccess 文件中删除 <br>
标签。如果前一个不起作用,请检查本地主机的 apache 配置,也许它不 AllowOverride
.
您还可以使用 here 中的步骤在 apache 上创建虚拟主机,并将其文档根目录设置为 tutorial
文件夹的路径。
每次更改 apache 的配置时,请记住重新加载或重新启动 apache 服务。
我想使用 learn phalcon,所以我尝试在 ubuntu 上安装它。我做了教程中的所有事情,我可以在 phpinfo() 中看到 phalcon。我使用以下 htaccess 文件制作了类似于教程中的示例项目,但在键入 localhost/tutorial 时我只能看到 /tutorial 的索引,而不是 Hello!留言
#/tutorial/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule ((?s).*) public/ [L]
</IfModule>
#/tutorial/public/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^((?s).*)$ index.php?_url=/ [QSA,L]
</IfModule>
尝试从您的 .htaccess 文件中删除 <br>
标签。如果前一个不起作用,请检查本地主机的 apache 配置,也许它不 AllowOverride
.
您还可以使用 here 中的步骤在 apache 上创建虚拟主机,并将其文档根目录设置为 tutorial
文件夹的路径。
每次更改 apache 的配置时,请记住重新加载或重新启动 apache 服务。