在尔康framwork友好的URL不工作在Ubuntu [英] Friendly URLs in phalcon framwork is not working in Ubuntu

查看:153
本文介绍了在尔康framwork友好的URL不工作在Ubuntu的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经试过这两个codeS。但它不工作。它需要访问公用文件夹了。

http://docs.phalconphp.com/en/latest/reference/ tutorial.html

#WWW /教程/的.htaccess

 < IfModule mod_rewrite.c>
    RewriteEngine叙述上
    重写规则^ $公共/ [L]
    重写规则(。*)公共/ $ 1 [L]
< / IfModule>
 

#WWW /教程/公/的.htaccess

 < IfModule mod_rewrite.c>
    RewriteEngine叙述上
    的RewriteCond%{} REQUEST_FILENAME!-d
    的RewriteCond%{} REQUEST_FILENAME!-f
    重写规则^(。*)$的index.php?_url = / $ 1 [QSA,L]
< / IfModule>
 

解决方案

如果的mod_rewrite 已启用,我的猜测是,你的服务器是不符合的AllowOverride 选项正确设置...

所有的的.htaccess 文件中默认的Apache忽略,因为一个人可以管理到的.htaccess 文件上传到服务器上,并覆盖你的服务器配置。如果你确信你的服务器的文件系统是受保护的,你可以明确在服务器的配置,你的设置,可以通过在目录中的任何的.htaccess 文件覆盖。

这是通过的AllowOverride 设置完成。请参阅 这个问题 了解多一点关于此

I have tried these two codes. but It is not working. It need to access public folder too.

http://docs.phalconphp.com/en/latest/reference/tutorial.html

#www/tutorial/.htaccess

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule  ^$ public/    [L]
    RewriteRule  (.*) public/$1 [L]
</IfModule>

#www/tutorial/public/.htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
</IfModule>

解决方案

If mod_rewrite is enabled, my guess is that your server isn't with the AllowOverride option properly set...

All .htaccess files are ignored by default in apache because someone can manage to upload a .htaccess file to your server and override your server configurations. If you're sure that your server's file system is protected you can explicit in the server's configuration that your settings can be overridden by any .htaccess file in your directories.

This is done via the AllowOverride setting. Refer to this question to understand a bit more about this.

这篇关于在尔康framwork友好的URL不工作在Ubuntu的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆