WordPress Snippet
Last active
July 17, 2018 13:08
-
-
Save ControlledChaos/4f9693d44ffc858d9672e7d372c98764 to your computer and use it in GitHub Desktop.
Stop WordPress attempts to guess the "correct" URL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function ccd_no_redirect_on_404( $redirect_url ) { | |
| if ( is_404() ) { | |
| return false; | |
| } | |
| return $redirect_url; | |
| } | |
| add_filter( 'redirect_canonical', 'ccd_no_redirect_on_404' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment