共享主机上的 Zend 框架 [英] Zend Framework on shared hosting
问题描述
我是 Zend 框架的新手.我想知道如何在共享主机上实现 zend 框架.由于zend框架文件夹结构所有视图文件都放在public"文件夹中.
I'm new to Zend Framework. I would like to know how to implement zend framework on a shared hosting. Because of the zend framework folder structure all view files are put into the "public" folder.
假设
"/" 是我的主要根文件夹,public 就像/公共"
"/" is the main root folder for me and public is like "/public"
这样 url 就变成了 "http://site/public/. .. .bla bla ..."
so that the url becomes "http://site/public/. .. .bla bla..."
这是正确的吗?
或者有其他方法吗?
我没有任何创建虚拟主机的权限.
i dont have any permission to create a virtual host.
那怎么办?
我希望你理解我的问题.如果没有,请问我.
I hope that you understood my question. If not, please ask me.
谢谢!
推荐答案
我认为最好的方法是将 .htaccess 从公共目录(Zend Framework 目录结构)中删除,并将其与以下内容一起放入您的根目录"" 目录:
i think the best way is to remove the .htaccess from the public directory (Zend Framework Directory structure) , and put it with the following content into your "root" directory :
RewriteEngine On
重写规则 ^.htaccess$ - [F]RewriteCond %{REQUEST_URI} =""重写规则 ^.*$/public/index.php [NC,L]
RewriteRule ^.htaccess$ - [F] RewriteCond %{REQUEST_URI} ="" RewriteRule ^.*$ /public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/public/.$重写规则 ^(.)$/public/$1RewriteCond %{REQUEST_FILENAME} -f重写规则 ^.*$ - [NC,L]
RewriteCond %{REQUEST_URI} !^/public/.$ RewriteRule ^(.)$ /public/$1 RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$/public/index.php [NC,L]
RewriteRule ^public/.*$ /public/index.php [NC,L]
这篇关于共享主机上的 Zend 框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!