Sorry if this is a duplicate but I didn't find my answer in "Questions that already have your answer".
Currently on my site if I visit an old URL link or if I outright make up a URL like
example.com/made-up-place.html I am getting redirected with a 302.
Whats weird is that it 302's by default instead of 301 for moved URLs, but I'm really intrigued as to why a URL that has never existed 302's back to the homepage. So my two questions are:
How do I force all 302 to 301 (I would think there is a hook to add into
Why would made up urls to a file 302 and not 404?
I would like some understanding of what I'm seeing.
My theme does have a 404 template that does work in some situations. Example:
Current site URL structure is:
- If I put in an invalid URL like example.com/id/999999 then i would get a 404 response which is expected.
example.com/id/999999/some-slugI see a 301 on some-slug followed by a 404 on the full URL.
example.com/some-made-up-thing.htmlthis goes to 302 instead of a 404. Past site structure was
example.com/slug(but no pages ever included the extension) and this page had never existed.
What is interesting is that this only occurs on the main domain. All subsites (example2.com, example3.com) all work correctly and as expected #1, #2, and #3 all 404 as they should!