If I visit
hagertyforjudge.dev
in my browser, I get a 301 redirect towww.hagertyforjudge.dev
Can WordPress push a 301 redirect?
Yes, it's quite probable that WordPress is issuing this canonical redirect to the host that is "baked into the WordPress database". I believe this is the default behaviour.
If WordPress is issuing the redirect (and the correct WordPress functions are being called to trigger the redirect) then this should be made known in the X-Redirect-By
HTTP response header on the redirect response itself. For example:
X-Redirect-By: WordPress
WordPress does not need a .htaccess.htaccess
file (or "Apache config") to "work". However, you miss out on some "pretty URL" functionality if it's not used. The www
canonical redirect (in .htaccess) is not part of a default WordPress install, however, many people add it since it is more efficient to do it this way (early in the request), rather than let WordPress handle it.
So How can a 301 redirect be happening? It has to come from Apache, right?
WordPress (ie. PHP) sets the appropriate HTTP response headers and Apache sends the response to the client. A 301 redirect is nothing more than an "HTTP status code" and a Location:
response header that is then processed by the browser.
it's not a cached 301 redirect either, as I forced Firefox to "forget" about the site via the history tab.
Just to clarify, the browser history is not the browser cache. To clear the cache go to: Options
Options > Advanced > Network > Cached Web Content > [Clear Now].