Zend Framework - 没有公共文件夹

Por*_*oru 1 apache zend-framework

我将在共享主机上托管应用程序,在那里我无法创建虚拟主机或在apache上更改某些内容.

通常使用ZF的应用程序看起来像这样:

    • 上市
      • 的index.php
      • 的.htaccess
    • 应用
    • 图书馆

我有...... 像那样:

    • 应用
  • 的index.php
  • 的.htaccess

我的所有代码都在应用程序文件夹中.但是也有一些带有敏感信息的.ini和.xml文件,例如登录名和密码等......

如果我在应用程序文件夹中添加.htaccess,文件夹deny from all中的信息是否安全?

Rob*_*len 8

我最近在http://akrabat.com/zend-framework/zend-framework-on-a-shared-host/写了这篇文章.

基础是:

在根文件夹中创建index.php:

<?php 
define('RUNNING_FROM_ROOT', true);
include 'public/index.php';
Run Code Online (Sandbox Code Playgroud)

在根文件夹中创建.htaccess文件:

SetEnv APPLICATION_ENV production

RewriteEngine On
RewriteRule .* index.php 
Run Code Online (Sandbox Code Playgroud)

也许在测试时将APPLICATION_ENV设置为开发:)

请注意,在引用静态文件时,baseUrl()视图助手现在指向根文件夹而不是公共/文件夹.