2010-06-21 144 views
0

我想建立一个Zend框架项目中的子目录:Zend框架的子目录

/public_html 
    /public_html/here_i_want_to_setup_zf 

文档根目录为/的public_html。我想通过这样的URI访问Zend Framework项目:

http://example.com/here_i_want_to_setup_zf 

我该如何编辑我的htaccess文件?

RewriteEngine On 

# Exclude some directories from URI rewriting 
#RewriteRule ^(dir1|dir2|dir3) - [L] 

RewriteRule ^\.htaccess$ - [F] 

RewriteCond %{REQUEST_URI} ="" 
RewriteRule ^.*$ /public/index.php [NC,L] 

RewriteCond %{REQUEST_URI} !^/public/.*$ 
RewriteRule ^(.*)$ /public/$1 

RewriteCond %{REQUEST_FILENAME} -f 
RewriteRule ^.*$ - [NC,L] 

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

回答

2

别碰htaccess的或文件夹结构!只需在中心点上进行以下操作:

Zend_Controller_Front::getInstance() 
    ->getRequest() 
    ->setBaseUrl('/here_i_want_to_setup_zf/'); 
0

我认为要实现这一点,您需要将您的index.php文件和.htaccess文件放在zend框架的根目录下。

公共html /名称到您的子目录,现在在您的子目录中有以下结构。

的index.php

/.htaccess

/库

/应用

/公共