Tag Archives: httpd

Apache .htaccess or httpd.conf to Force non-WWW to WWW

The following is a very simple and straightforward method to force, in Apache, non-WWW domains to WWW. There is also an example of how it would work with HTTPS. These can be used in httpd.conf or in a .htaccess file.

To maintain HTTPS:

By the way, the reverse (WWW to non-WWW) is as simple as this:

Unfortunately, it’s not as simple, though I’m sure someone can provide a better example.