2017-05-17 6 views
0

私は最近、Digital OceanのUbuntuでLAMP設定にLaravel 5.1アプリケーションを導入しました。 http://159.203.82.91/で私の液滴へのアクセスDigital Ocean Ubuntu LAMPサーバー:Laravelがルータグループにアクセスできない

が私を取得します。

enter image description here

これは私が1.0のルートプレフィックス(下記参照)、http://159.203.82.91/1.0を設定した

作品

ただし、読む必要があります

これはありません!

$router->group(['middleware' => 'cors'], function(Router $router) { 
     $router->get('/', function() { return 'This Works'; }); 
     $router->group(['prefix' => App\Http\Controllers\Controller::API_VERSION], function(Router $router) { 
       $router->get('/', function() { return 'This does not!'; }); 

なぜそれが私が/1.0ようindexではなくsubrouteにアクセスできるということですか?


[email protected]:/var/www/html# cat public/.htaccess 
<IfModule mod_rewrite.c> 
    <IfModule mod_negotiation.c> 
     Options -MultiViews 
    </IfModule> 

    RewriteEngine On 

    # Redirect Trailing Slashes If Not A Folder... 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)/$ /$1 [L,R=301] 

    # Handle Front Controller... 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteRule^index.php [L] 

    # Handle Authorization Header 
    RewriteCond %{HTTP:Authorization} . 
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 
</IfModule> 

--- enter image description here

+1

あなたは 'public/.htaccess'がそこにあり、' .htaccess'の使用を許可するためにApacheの設定で 'AllowOverride'ディレクティブを使用しましたか? – Bilal

+0

@Bilal htaccessがあります。上記を参照。 'AllowOverride'はどこですか? – Growler

+0

IPをLaravelのパブリックフォルダにマップする仮想ホストを作成しましたか? – Bilal

答えて

関連する問題