0
votes

The server's operating system is Debian 8.6 (jessie)...
The index.php and the .htaccess file are located in /var/www/html and the Laravel project is located at /var/www
From index.php, I can require the autloload.php and app.php file and I can browse the homepage ('/').
but, when I am trying to browse in login ('/login') page, this error is showing

The requested URL /login was not found on this server.

The .htaccess file in the html folder is this -

<IfModule mod_rewrite.c>
  <IfModule mod_negotiation.c>
    Options -MultiViews
  </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

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


What can be the problem here?

I have set up the login route in web.php file..

1
Did you set your "/login" path from your "route.php" file?iMarkDesigns
Also make sure that in your VHOST settings you have "AllowOverride All" for that directory and reload Apache's settings. It's a common gotcha. Basically your mod rewrite might not be working if this is denied for some reason. Another idea is to check if you have the mod_rewrite module enabled on your server's configuration. Some installations of Apache don't have it. Your routes.php file is not needed here as Laravel is not loading. You are getting a generic apache error. Perhaps check your errors log file for more information. Default is /var/log/apache2/errors.log. Post your VHOST config.Sk1ppeR
i can see that the .htaccess seems fine. if your still having issue over my answer, yeah follow @Sk1ppeR suggestion.iMarkDesigns
I sorry that I forgot to mention that I have set up the '/login' route in web.php.....Jakaria Blaine
Check the errors log file see what the server is trying to execute. Did you restart Apache after you changed the config? You must restart/reload the server after every change you do. Posting VHOST block will help the most to find where your problem resides at though. On debian you shouldn't be putting VHOSTS in apache2.conf there are separate folders for VHOSTS. Try the example from here afterwards - laravel.com/docs/5.0/configuration#pretty-urls Out of the box Laravel has a proper .htaccess. Something else is wrong with your setup my friend.Sk1ppeR

1 Answers

0
votes

You can achieve the /login path by configuring it inside your route file. Something like this.

Route::get('/login', function(){
  return View::make('user-login');
});

If you are going to put another folder the login, it can be done something like this.

Route::group(['prefix' => 'login'], function() {

  Route::get('/', function(){
    return View::make('portal/user-login');
  });

  Route::get('/forgot-password', function(){
    return View::make('portal/user-forgot');
  });

  Route::get('/reset-password', function(){
    return View::make('portal/user-reset');
  });

  Route::get('/dashboard', function(){
    return View::make('portal/dashboard');
  });

});

Explanation

Route:get() will be the function to specify your url path. While, return View::make('portal/user-login') will be your function to locate your file-blade.php.

I put and organize my login folder and use Route::group instead of having all Route::get('login/') to all of my codes.

Hope this help.