【问题标题】:Zend Framework URL problemsZend 框架 URL 问题
【发布时间】:2014-02-05 22:31:52
【问题描述】:

URL http://l o c a l h o s t/HelloZend/public/index.php/artist/ 工作正常,但我不喜欢看到 index.html。 php 放在那里。 如果 URL 是 http://l o c a l h o s t/HelloZend/public/artist/ 那么消息是

未找到 - 未找到请求的 URL /HelloZend/public/artist/ 在这台服务器上。

有什么问题?我已经尝试配置 Apache,但在那种类型的 URL 中,它总是尝试打开文件夹 /a r t i s t / 而不是调用控制器 a r t i s t或 URL 中的任何内容。控制器/动作等情况也是如此。

【问题讨论】:

标签: php url zend-framework


【解决方案1】:

您需要将 .htaccess 文件添加到您的公用文件夹

.htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-04
    • 1970-01-01
    • 1970-01-01
    • 2012-08-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多