donglie7778 2014-06-05 00:50
浏览 47
已采纳

phalcon框架中的友好URL在Ubuntu中不起作用[关闭]

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>
  • 写回答

2条回答 默认 最新

  • donglang1894 2014-06-05 02:06
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?