框架使用中的url重定向新手有关问题

WBOY
Release: 2016-06-13 12:22:16
Original
836 people have browsed it

框架使用中的url重定向新手问题
在使用ZendFramework时需要使用URL重定向功能统一网站访问的入口。
我使用的服务器软件是Apache2.4,url重定向规则我是这么写的:
RewriteCond  %{REQUEST_URI}    !^.*(\.js|\.gif|\.jpg|\.png|\.css|\.html)$
    RewriteRule  ^/.*$    /index.php
然而这么写有一个问题,因为把url都重写成/index.php了,所以网站就没办法在url中传递传递参数了。
那我现在的问题就是:有什么办法能即将所有的访问都重定向到index.php而且还可以在url传递参数吗?
------解决思路----------------------
其实你应该用他自带的重写规则
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ iindex.php/$1 [QSA,PT,L]

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!