私はzendアプリケーションをデプロイしたサブドメインを持っていますが、問題はそれがabc
というディレクトリを指していて、それをpublic
というディレクトリに指し示すように変更できません。 public
ディレクトリにリダイレクトされる.htaccess
ファイルをルートに置くことはできますか?それはできますか?私はそれが パブリックディレクトリへのリダイレクトリクエストzend
私のindex.phpパブリックディレクトリ内の
<?php
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
->run();
私.htaccess
パブリックディレクトリ内
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
は、現在のディレクトリ構造は
/myroot
-.settings
-application
-docs
-library
-public
-tests
-.buildpath
-.proect
-.zfproject.xml
のように見えます
シンボリックabc to public? –
@AlexHowanskyは、サブドメイン –
のルートを指しているサーバーが現在mysubdomain/publicを指しているような錯覚を作り出すには、どのように作成することができますか?あなたのWebサーバーの設定に/ path/to/abcがドキュメントルートとして設定されていて、それを変更できない場合は、/ path/to/abc(存在する場合)を削除(または名前変更)して次のようにしてください: 'ln -s/path/to/mysubdomain/public/path/to/abc'これは/ path/to/abcをWebサーバに存在させるようにしますが、それは他の場所にあるあなたのアプリへのポインタに過ぎません。 –