0

I have successfully installed laravel on Google VM instance Server address is '104.155.222.192'. When I open base URL Route works fine but when I access another URL like "104.155.222.192/home" it throws:

404 Not Found

Please Help me to know, how to solve this.

Here is the code of my route.php

Route::get('/', function(){
    if(Auth::check()){
        return redirect('home');
    }
    return view('pages.index');
});

Route::controllers([
    'auth'      =>  'Auth\AuthController',
    'password'  =>  'Auth\PasswordController'
]);

Route::get('home', 'PageController@home')->middleware(['auth']);
Route::get('about','PageController@about');


Route::get('{userid}', 'ProfileController@index');
Route::get('{userid}/edit', 'ProfileController@editProfile')->middleware(['auth']);

Here is the .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]

As far a I analysed it may be a error of htaccess because when I open "http://104.155.222.192/index.php/auth/register" it also works fine.

I am using Ubuntu 15.10 and apache2 server

I have changed 000-default.conf from html to public directory

Amit Kumar
  • 318
  • 2
  • 14

0 Answers0