2016-05-03 103 views
0

Laravelアプリケーションを自分の共有ホスティングアカウントに展開しようとしています。Apacheエラー:一致するDirectoryIndexがありません

次のようにフォルダ構造は次のとおりです。

|--laravel 
    |--app 
    |--GoPublic.php // use to point to new location 
    |--bootstrap 
    |--config 
    |--database 
    // more folders 
|--public_html 
    |--app // my subdomain document root 
    |--assets 
    |--index.php // GoPublic.php point to this file 

私は私のサブドメインのURLに行くとき、私はこの取得:

enter image description here を、私は私のError.logファイルをチェックしましたし、私は、次の取得403禁じられたエラー:

[autoindex:error] [pid 910782] [] AH01276: Cannot serve directory /home/user/public_html/app/: No matching DirectoryIndex (index.php,Index.html,Index.htm,index.html.var,index.htm,index.html,index.shtml,index.xhtml,index.wml,index.perl,index.pl,index.plx,index.ppl,index.cgi,index.jsp,index.js,index.jp,index.php4,index.php3,index.phtml,default.htm,default.html,home.htm,index.php5,Default.html,Default.htm,home.html) found, and server-generated directory index forbidden by Options directive 

誰でも私を助けることができます。ありがとう!

+0

Laravelディレクトリ構造を分割しました。 /public/index.phpはWebサーバーのエントリポイントです。あなたが持っているものでは、あなたの環境に特有のものです。誰も助けてくれるとは言いません。 – Josh

+0

これを解決するにはどうすればよいですか? –

+0

Laravelの構造を同じにして、サブドメインを/ laravel/public /にしたいとします。 – Josh

答えて

0

laravalディレクトリとlaravel/publicディレクトリに.htaccessを追加できます。

<IfModule mod_rewrite.c> 
WriteEngine On 
RewriteBase /laravel/public/ 
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</IfModule> 

Laravelをパブリックディレクトリに設定して機能させる必要があるかもしれません。そのApacheを再起動した後

DocumentRoot "/path_to_laravel/public/" 
<Directory "/path_to_laravel/public/"> 

をし、期待どおりにアプリが動作するはずです:たとえば、あなたが/path_to_laravel/public/ディレクトリにLaravelをインストールした場合は、Apacheの設定でこれらの設定を使用する必要があります。

関連する問題