如何在Zend 2框架中发送基本路径?

时间:2016-09-27 05:36:24

标签: php zend-framework routing zend-framework2

我是zend 2的新手。我已经运行了这个应用程序,它可以正常工作,但访问其他页面或控制器,它可以给404错误....

http://localhost/Gojavas/public/

enter image description here

点击登录按钮

  

http://localhost/branch/login

自动删除网址中的主文件夹.....并显示404页面错误...请帮助我.... thanx

  

Htaccess文件

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on 
RewriteBase /Gojavas/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]

 <ifmodule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</ifmodule>

1 个答案:

答案 0 :(得分:0)

请试试这个,

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

...表示如果浏览器中具有指定名称的文件不存在,或者浏览器中的目录不存在,则继续执行下面的重写规则

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ %{ENV:BASE}index.php?/$1 [QSA,L]