问题
I am new in zf2. Please help me.
I setup my new zend project on www.example.com/zend/
directory
but it didn't call directly. Its call via www.example.com/zend/public
How can i access directly access by www.example.com/zend/
this url. I don't want to any changes in virtual host. I want only use of .htaccess
file.
Kindly suggest me solution.
回答1:
Setup an htaccess file in your /zend/
directory:
RewriteEngine On
RewriteBase /zend/
RewriteRule ^(?!public/)(.*)$ public/$1 [L]
回答2:
This is not possible in Apache web server. You can define virtual hosts only in .conf files, but not in .htaccess files.
来源:https://stackoverflow.com/questions/21452554/how-to-access-public-folder-in-zf2-by-htaccess-subdomain