Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/282.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Zend框架URL问题_Php_Url_Zend Framework - Fatal编程技术网

Php Zend框架URL问题

Php Zend框架URL问题,php,url,zend-framework,Php,Url,Zend Framework,URL http://lo c a l h o s t/HelloZend/public/index.php/artist/工作正常,但我不喜欢看到index.php放在那里。 如果URL是http://loccaalhostt/HelloZend/public/artist/则消息为 未找到-未找到请求的URL/HelloZend/public/artist/ 在这个服务器上 有什么问题吗?我已经尝试配置Apache,但在这种URL类型中,它总是尝试打开文件夹/a r t I s t/,而不是

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

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


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

您需要将.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]

可能重复的请发布您的Apache配置文件。