1

I've got a situation where I don't want www to redirect to the domain, or the domain to redirect to www.

I looked around and found

remove_filter('template_redirect', 'redirect_canonical');

I added this to my functions file, but the site still redirects. I don't understand it enough to do anything about it.

My site is running nginx, and I thought maybe it was related to the config file there, but I didn't see anything.

Anywhere else I can look to fix this? Thanks Rich

  • I don't entirely understand your question. Are you trying to have your website show only example.com and not www.example.com? Please elaborate more so we better understand your situation and provide a quick solution. – Ethan Jinks O'Sullivan Sep 15 '16 at 18:15
  • If a user requests example.com, it I don't want it to redirect to www.example.com. Also, if a user requests www.example.com I don't want it to redirect to example.com. – Richard Testani Sep 15 '16 at 21:15
  • What is your WordPress site set up using? The www or non-www? – Ethan Jinks O'Sullivan Sep 16 '16 at 23:02
  • The site is setup with site.com. One thing I cannot tell if its WordPress of if its Nginx doing the redirecting. In the Nginx config, I don't see anything for www or redirect. – Richard Testani Sep 16 '16 at 23:09
  • 1
    I see. This would be on the hosting side then, look at your DNS settings for your domain and you will see that the www will be pointing to the same IP as your non-www. – Ethan Jinks O'Sullivan Sep 16 '16 at 23:16

Your Answer

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

Browse other questions tagged or ask your own question.