I modified my functions.php so that it requires users to be logged in to access the WP REST API. The changes work perfectly when the site is accessed without 'www'. However, it does not work when the site is accessed with 'www'. Shouldn't the functions.php file apply to the entire site, regardless of www or non-www?
Solved! Go to Solution.
Technically, non-www and www are 2 separate domains/subdomain but most sites serve the same content.
I can think of 3 ways this could happen off the bat...
2) You have 2 WP installations, one is being served as www and the other is non-www.
3) Scripts are executing relative to domain.