Opened 2 years ago
Last modified 2 years ago
#60330 new defect (bug)
redirect that working incorrectly!
| Reported by: | markuscode | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Rewrite Rules | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
Issues that once you going to for example https://example.com/example-page-slug/1000/ will redirect you to https://example.com/example-page-slug/ . But it's supposed to display 404 page. Is bad for SEO because that redirect using 301.
<?php 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)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I gave it a go myself, and I'm seeing the same behaviour as you reported. URLs like https://example.com/example-page-slug/1000/ are redirecting to https://example.com/example-page-slug/ instead of showing a 404 page. That 301 redirects isn't doing our SEO any favours.
Environment