在尔康framwork友好的URL不工作在Ubuntu友好、尔康、工作、Ubuntu

2023-09-02 00:37:12 作者:长发及腰我也不娶你

我已经试过这两个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>
 
网站优化运营中移动端URL不变有什么好处呢

解决方案

如果的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.