2010-06-21 83 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

/庫

/應用

/公共