We have a site whose blog url looks like www.domain-name.com/blog. The blog archive pages have urls like www.domain-name.com/blog/page/1, www.domain-name.com/blog/page/2 etc... These are displayed properly. However, when I type a url such as www.domain-name.com/page/1 or www.domain-name.com/page/2, which are non-existent urls, I get redirected to the blog home page instead of getting a 404. I do not want the 404 suppression to happen. What can I do to get a 404 for non-existent wordpress pages?
I have the same issue with a querystring url that looks like www.domain-name.com/blog/?xyz. Although no such page exists, wordpress suppresses the 404 error and displays the blog home page. How can I circumvent this default behaviour of Wordpress and make it display the 404 page for such urls? Thanks!
404.php
file in your theme's directory?