I have a single-site Wordpress installed on example.com. The DNS is configured so that www.example.com is an ALIAS of example.com. The client wants the user to see www. on their nav bar if they entered it, so this is important.
I hosted their website on an apache server running cpanel. The cpanel has the domain set as example.com. Before I installed wordpress, typing www.example.com brought up the directory and kept the www. on the nav bar, so great.
After I installed wordpress though, the www. is getting removed. When I did a redirect trace I found this odd 302 redirect:
http://www.example.com
Status: 302 Found
Code: 302
Date: Thu, 24 Aug 2017 00:23:08 GMT
Server: Apache/2.4.16 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4
Location: https://example.com
Content-Length: 346
Connection: close
Content-Type: text/html; charset=iso-8859-1
I modified wordpress's htaccess file to force ssl, but I thought this is a 301:
SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq "example.com"
ErrorDocument 403 https://example.com
Okay, whatever. So I removed this section of code, the URL bar is still not preserving the www. This time I get a 301 redirect:
http://www.example.com
Status: 301 Moved Permanently
Code: 301
Date: Thu, 24 Aug 2017 00:35:22 GMT
Server: Apache/2.4.16 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4
X-Powered-By: PHP/5.6.16
Location: http://example.com/
Content-Length: 0
Connection: close
Content-Type: text/html; charset=UTF-8
I don't know where else to look. What do I need to do in cpanel, htaccess, or wordpress to have the URL bar preserve the www.