【问题标题】:zend framework deployment in server服务器中的zend框架部署
【发布时间】:2011-04-14 18:50:49
【问题描述】:

我有一个服务器,我在 zend 框架中上传了我的工作(在一个子域中)。文件夹名称是“访问”。

所以,当我转到:http://mysitename.com/visit 时,它显示了一个目录结构:

Parent Directory
application/
docs/
library/
nbproject/
public/
tests/

但是当我转到:http://mysitename.com/visit/public 时,我得到了我的项目的索引页。

但我想得到我的索引页,当我输入:http://mysitename.com/visit

你能给我它需要的正确的 htaccess 吗?

【问题讨论】:

    标签: zend-framework .htaccess deployment


    【解决方案1】:
    【解决方案2】:

    您可以使用以下规则集执行此操作,该规则集部分是 one described in the documentation 的部分修改版本。

    .htaccess 文件在 /visit:

    RewriteEngine on
    
    # Guard against people visiting /public/ directly
    RewriteCond %{THE_REQUEST} ^[A-Z]\s/visit/public/
    RewriteRule ^public/(.*)$ /visit/$1 [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    # Make sure we've rewritten to the ./public/ directory already
    RewriteCond $0 ^public/
    RewriteRule ^.*$ - [NC,L]
    # The index file is now at /visit/public/index.php
    RewriteRule ^.*$ /visit/public/index.php [NC,L]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-04
      • 1970-01-01
      • 2021-05-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多