How To Redirect www To non-www And Vice Versa with Nginx

In this short tutorial I’ll show you how to make permanent redirect from a www URL to non-www and vice versa. I’ll assume that you have superuser privileges, sudo  or root access and Nginx already configured, as well as DNS records. More specifically, you need to have an A records for  and .

Redirect non-www to www

To redirect users from a plain, non-www domain to a www domain, you need to add this snippet in your Nginx domain configuration file:

Save your configuration and exit. Before restarting Nginx make sure to test your configuration:

Continue reading How To Redirect www To non-www And Vice Versa with Nginx

Setting Up Laravel Environments

Setting up a development environment is an important task you should do before starting any project. We all know that Laravel has a lot of cool features and one of things I like a lot is how easy is to set environments on your machine. Official documentation page provides you a lot of useful information about it, so make sure you check it.

Typically for each project you would need to have development, staging and production environments. All of these should be on separated servers, so configuring each environment can be a bit tricky.  But not with Laravel. Continue reading Setting Up Laravel Environments