【问题标题】:how to set baseurl while deployment in zend framework在zend框架中部署时如何设置baseurl
【发布时间】:2014-02-12 06:45:27
【问题描述】:

这是我的网址 https://abc.com/project/projectfolder/public/

它显示 404 not found 错误 有两个 .htacess 一个在 public 文件夹下,另一个在 projectfolder 下 现在请告诉我该怎么做

这是.htacess

选项 +FollowSymLinks 选项 -MultiViews

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

【问题讨论】:

    标签: zend-framework base-url


    【解决方案1】:

    在最后一条规则中省略前导斜杠:

    RewriteRule ^.*$ index.php [NC,L]
    

    【讨论】:

      【解决方案2】:

      使用以下,

      RewriteEngine On
      RewriteBase / 
      RewriteCond %{REQUEST_FILENAME} -s [OR]
      RewriteCond %{REQUEST_FILENAME} -l [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^.*$ - [NC,L]
      
      RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php
      

      【讨论】:

      • 它在我的页面上显示 css 部分,但它从不加载索引控制器。 url的application.ini文件是否需要更改?
      猜你喜欢
      • 1970-01-01
      • 2012-03-05
      • 2012-05-03
      • 1970-01-01
      • 1970-01-01
      • 2021-02-07
      • 1970-01-01
      • 2011-04-06
      • 2011-04-14
      相关资源
      最近更新 更多