如何从URL Zend框架中删除的index.php [英] How to remove index.php from url in Zend Framework

查看:77
本文介绍了如何从URL Zend框架中删除的index.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发使用Zend Framework 1.12这个程序。我婉摆脱掉的index.php 使用的.htaccess。现在我的网址是这样的:

I am developing this app using Zend Framework 1.12. I wan to get rid off the index.php using .htaccess. Right now my url looks like this:

http://foo.com:10080/Reports_Century/public/index.php/reports/neworders

我希望能够像这样

I want to be able to look like this

http://foo.com:10080/Reports_Century/public/reports/neworders

这可能吗? 我的htaccess的长相有下面几行:

Is it possible? my htaccess looks has the following lines:

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

感谢你。

推荐答案

让你的公共/ .htacess 是这样的:

RewriteEngine On
RewriteBase /Reports_Century/public/

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

RewriteRule ^(.+)$ index.php/$1 [L]

这篇关于如何从URL Zend框架中删除的index.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆