laravel 5.1とWAMPサーバー2.5を使用しています。
ルートを指す「www.example.com」のようなドメインがあります。 他に「admin.examle.com」のようなサブドメインがあります。
Route::group(["prefix" => "app", "middleware" => "authentication"], function () {
Route::get("home", ["as" => "app.home", "uses" => "DashboardController@home"]);
});
以下のように、httpd-vhosts.confに仮想ホストを追加しました。
<VirtualHost *>
ServerName www.example.com
ServerAlias example.com
DocumentRoot "C:/wamp/www"
</VirtualHost>
<VirtualHost *>
ServerName example.com
DocumentRoot "C:/wamp/www/app"
ServerAlias app.example.com
</VirtualHost>
ただし、アプリはwwwフォルダー内の実際のフォルダーではないため、内部サーバーエラーが表示されます。誰でもこれを助けることができますか?同じためにサブドメインを使用する必要があります。
回答:
回答№1は0- DocumentRootを確認してください。すべてのLaravelアプリケーションを指す必要があります パブリック index.phpファイルがあるディレクトリ
- ホストファイルを確認してください (私はWindowsユーザーです)、このファイルを使用すると、Webブラウザーはドメインを特定のIPに向けることができます(たとえば、mysubdomain.myapp.localを使用)。ホストファイルの詳細を読むには http://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/