Make WordPress Core

Opened 5 months ago

Last modified 3 months ago

#60330 new defect (bug)

redirect that working incorrectly!

Reported by: markuscode's profile markuscode Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Rewrite Rules Keywords:
Focuses: Cc:


Issues that once you going to for example will redirect you to . But it's supposed to display 404 page. Is bad for SEO because that redirect using 301.


class RedirectFixer {
        function __construct(){
                add_filter('request', array($this, 'request'),10,1);

        function request($query) {
                if(isset($query['page']) && (int)$query['page'] > 0) {
                        $query = array(
                                'pagename' => '404'
                return $query;
new RedirectFixer();

This is how to fix it.

Change History (4)

#1 @jrf
5 months ago

  • Focuses accessibility php-compatibility removed

#2 @jrf
5 months ago

  • Component changed from Security to Rewrite Rules

#3 @deepakvijayan
5 months ago

I gave it a go myself, and I'm seeing the same behaviour as you reported. URLs like are redirecting to instead of showing a 404 page. That 301 redirects isn't doing our SEO any favours.


  • WordPress: 6.4.3
  • PHP: 7.4.33
  • Server: Apache/2.4.54 (Unix) OpenSSL/1.0.2u PHP/7.4.33 mod_wsgi/3.5 Python/2.7.18 mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_perl/2.0.11 Perl/v5.30.1
  • Database: mysqli (Server: 5.7.39 / Client: mysqlnd 7.4.33)
  • Browser: Chrome (macOS)
  • Theme: Twenty Twenty-Four 1.0
  • MU-Plugins: None activated
  • Plugins:
    • WordPress Beta Tester 3.5.5

#4 @QROkes
3 months ago

I can confirm this issue!

Also, it only happens when the SSL Cert (HTTPS) is set before running the initial WP installation (install.php). If the SSL Cert is set on an existing site (after install.php), this issue is not present.

Note: See TracTickets for help on using tickets.