How to Redirect www to Non-www with Apache

Many web developers need to allow their users to access their website or application via both the www subdomain and the root (non-www) domain. This tutorial shows how to configure the Apache web server to redirect requests from a www subdomain to the root domain.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.