繁体   English   中英

PHP Zend Framework应用程序需要URL中的index.php才能在CENTOS上运行

[英]PHP Zend Framework Application needs index.php in URL to operate on CENTOS

仅当我在URL末尾添加“ index.php”时,该应用程序才能工作。 我正在使用CENTOS。 如何删除它,因此例如可以转到http://server/admin/dashboard而不是http://server/admin/index.php/dashboard 这是我的htaccess文件:

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

谢谢。

这是我使用的,如果我没记错的话,我是从Rob Allen那里得到的:

//index.php
<?php
$_SERVER["REQUEST_URI"] = str_replace('index.php', '', $_SERVER["REQUEST_URI"]);
//rest of index.php

还有其他方法可以做到,这只是我选择的一种。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM