1

I developed a project in zend framework 1.12 Now I want to deploy it on server. I have a shared hosting. I uploaded all files and folders to public_html folder (application, library, public). When I am opening domain as www.domainname.com it shows all the folders listing, and I need to type as www.domainname.com/public/ then I am able to see my index page.

I can't create virtual host in apache.conf because its on shard hosting.

Please suggest how can I show index page when I type only domain name.

4

2 回答 2

0

在根目录中创建一个 .htaccess 文件

RewriteEngine on
RewriteRule (.*) public/$1

并将以下行添加到您的 application/configs/application.ini 文件中

resources.frontController.baseUrl = "/myapp/"

不会有错误它会正常工作。

于 2013-11-06T06:05:04.197 回答
0

您无需在实时服务器上创建虚拟主机。将 public 文件夹中的所有内容放入 public_html 文件夹。然后将所有其他文件和文件夹移到 public_html 之外。所以结构是这样的:

/
 -config
 -data
 -module
 -pulic_html
   -index.php
 -vendor
 -init_autoloader.php

其他 zend 框架文件和文件夹必须位于服务器的根文件夹中。这样您就可以保护所有 php 文件,因为它们对访问者不可见且无法访问。

于 2013-11-06T05:56:58.687 回答