服务器中的zend框架部署

时间:2010-09-20 16:31:33

标签: zend-framework .htaccess deployment

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

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

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

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

但是当我输入http://mysitename.com/visit

时,我想要获取我的索引页面 你能告诉我它需要的正确的htaccess吗?

2 个答案:

答案 0 :(得分:3)

答案 1 :(得分:0)

您可以使用以下规则集执行此操作,该规则集部分是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]