我在共享主机服务器上,我将把zend应用程序放置在那里,但我无法触及httpd.conf文件来制作虚拟主机,因为它是共享主机,并且他们不允许我这样做。我应该把index.php放在Zend Framework的公共文件夹之外吗?
如果我在公用文件夹中保留index.php文件和.htaccess,我必须制作一个虚拟主机来隐藏公共URL。
所以,我虽然我可以把公共文件夹文件(index.php,.htaccess)在网站的根,因此我不需要为此创建一个虚拟服务器,我的网站是可以访问的,而不需要在url中公开。
如果我把index.php文件从公共文件夹中删除,是否有任何事情使我的网站不安全?
我说的英文不太好,太吸引人了。我从其他帖子复制的东西来描述我想解释的事情。
我已经试过这种方式,但它仍然无法正常工作,当我键入本地主机,它返回 “未找到对象”/公/ zend /中
目录结构:
zend/
application/
library/
public/
index.php
.htaccess
.htaccess
公共文件夹中
内容的.htaccess的:htaccess的在根˚F
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
内容老:
SetEnv APPLICATION_ENV development
RewriteEngine On
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]
我已更新了一些内容,请参阅我的问题帖子。谢谢! – 2013-02-24 13:27:12