共享主机上的Zend Framework [英] Zend Framework on shared hosting

查看:76
本文介绍了共享主机上的Zend Framework的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Zend Framework的新手。我想知道如何在共享主机上实现zend框架。由于zend framework文件夹结构
,所有视图文件都放在公共文件夹中。

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就像
/ 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.

谢谢!

推荐答案

我认为最好的方法是从公共目录(Zend Framework目录结构)中删除.htaccess文件,并将其与以下内容一起放入您的根目录中:

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

RewriteRule ^ .htaccess $-[F]
RewriteCond%{ REQUEST_URI} =
RewriteRule ^。* $ /public/index.php [NC,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]

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 Framework的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆