0

I installed a website and apparently the external DNS all worked fined to access the site: http://example.com

The problem was that internally, when on their network, they couldn't access the site, which I wasn't sure why as they kept on getting the error: Could not resolve DNS server.

Eventually their network guy came back to me and told me that they solved it as apparently WordPress was stripping away the www from their URL.

My question is, does WordPress actually strip away the www?

If so, do I need to set the Site (URL) to actually be: http://www.example.com as apparently he tells me that this is not ideal practice?

I have installed alot of WordPress sites and in the Site (URL), I have never included the www at the beginning.

Would appreciate your help.

4

Wordpress will always redirect to the canonical URL of the content if you try to access a page not with its canonical url. If you installed wordpress without using a www then wordpress will assume that the root url for the install is without www. Or in other words, wordpress is not actively removing www, it is just a by-product of eliminating possibility of duplicate content.

As for whether you should use www or not, frankly this is the first time in the last 15 years I have heard of anyone that do not treat them the same..... but if he is responsible for your pay check, you can just change the "site url" and "home url" options in the general setting to have www and probably nothing more than that.

  • Just to confirm, when you say "home url" option in general settings, you mean: WordPress Address (URL) right? – tonyf Dec 13 '16 at 13:19
  • Oh yes, either they changed the label or I just remember the terms used in the code... – Mark Kaplun Dec 13 '16 at 13:29
2

As far as I know it goes by what you define in your settings. If you was to add www. to the Site URL and the WordPress address it should work. I just tested it on one of my sites removing the www and then adding it back in.

WordPress does make an assumption as to what your site address would be so if you've setup in plesk for instace for the domain to be example.com then the URL would defualt to that. I personally don't therefore mine default to www.example.com

I don't believe WordPress will remove the www. from your URL if thats the address you have specified.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.