This is my favorite and I think the more simple if you want permanent redirect from NON WWW to WWW insert the following code in the nginx configuration file nginx.conf :
server {listen 80;server_name www.debian-tutorials.com;rewrite ^/(.*)$ http://debian-tutorials.com/$1 permanent;}
server {listen 80;server_namedebian-tutorials.com;rewrite ^/(.*)$ http://www.debian-tutorials.com/$1 permanent;}
Enjoy!

Recent Comments