Laravel – After login, how to change default redirect to home page

After successful authentication of a user, they are authenticated to /home. /home is the default path which is set by Laravel 5.2/5.3, you can change this by updating redirectTo property in below files:


protected $redirectTo = '/home';


protected $redirectTo = '/home';


if (Auth::guard($guard)->check()) {
return redirect('/home');

How to 301 redirect from www domain to non www domain using htaccess

Enable mod_rewrite module in apache.

Setting the “RewriteBase /”, sets the base of the URL to “/”

Replace with your website domain name.

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [L,R=301,NC]