从zend框架网址中删除index.php
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了从zend框架网址中删除index.php,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1376字,纯文字阅读大概需要2分钟。
内容图文
![从zend框架网址中删除index.php](/upload/InfoBanner/zyjiaocheng/695/1ff4973c64734106af201ceccc5f6c3a.jpg)
我正在使用zend框架开发模块,并且已经使用zf create project创建了一个项目
命令
当我尝试使用ip / folder / controller / action访问url时出现错误未找到错误我尝试使用ip / folder / index.php / controller / action进行访问时我能够访问,但我无法包含js ,两种情况下的css文件,我的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]
并且index.php是
<?php
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV')
? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR,
array(realpath(APPLICATION_PATH . '/library'), get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()->run();
解决方法:
尝试将其添加到您的.htaccess中:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /([^/]+/)*index.php
RewriteRule ^index.php(.*)$/path/to/your/installation$1 [R=301,L]
用正确的路径替换/ path / to /您的/安装
内容总结
以上是互联网集市为您收集整理的从zend框架网址中删除index.php全部内容,希望文章能够帮你解决从zend框架网址中删除index.php所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。