Page 1 of 1

Using nginx redirect www to non-www domain

Wojtek on nginx, redirect, domain · 07.07.2019 · Comments · 1 min read

To redirect all traffic from www.example.com to just plain example.com, add another `server {}` block to your nginx config file with just two lines: server { server_name www.example.com; return 301 $scheme://example.com$request_uri; }... Read more »

Page 1 of 1

All your code are belong to us

All your code are belong to us

Thoughts, stories and ideas on code and technology in general.
Blog title inspired by this meme

Search

Recent posts

  • How to Install the Latest PHP Version on Windows Subsystem for Linux (WSL) a year ago
  • Network-attached storage (NAS) on local network with Raspberry PI 3 years ago
  • Install latest Python version on Raspberry Pi 3 years ago
  • Configure local website on WSL2 with PHP and nginx 5 years ago
  • Upgrade Raspbian from Jessie to Stretch 5 years ago
  • Install any version of NodeJS and npm on Raspberry Pi 5 years ago
All your code are belong to us © 2025
Proudly published with Ghost. Theme: Strider by Mataba and SixBytesUnder.