This is normal, it is because redirect_canonical()
, which makes sure you are always at a “canonical” URL (conforming to your permalink structure), executes redirect_guess_404_permalink()
to make a best guess at a post when the URL is incomplete. If you want to prevent this, I think the best way is to hook into the redirect_canonical
filter, and return false if it is a 404. Something like this:
add_filter('redirect_canonical', 'no_redirect_on_404');
function no_redirect_on_404($redirect_url)
{
if (is_404()) {
return false;
}
return $redirect_url;
}
Related Posts:
- How to redirect non-logged in users to a specific page?
- When I change slug, will WordPress create redirect from the old URL?
- Why is WordPress redirecting from http to https on a local environment?
- How to change the default logout link on WordPress Admin
- How to redirect after login, the working way?
- How to setup 301 redirects for multiple query string URLs?
- Redirecting old permalink to new one
- WP auto redirects after url change?
- Setting a redirect cookie in wordpress
- Redirect users after first login
- Redirect to current page after wordpress login
- How does WordPress redirect to WooCommerce shop page? [closed]
- htaccess redirect not working
- htaccess wildcard redirect misses some URLs
- 301 Redirect Custom URL hierarchy to WordPress Posts
- Plugin Redirect After Activation
- $_SESSION variables lost during OAuth callback
- 404 redirection and Google’s index [closed]
- Redirect user after logout
- Wp Login redirect strips parameters from url
- Mixed Content with SSL, wordpress behind a reverse proxy
- 302 redirect to signup with nginx reverse proxy
- Strange redirection issues on wordpress from ssl with padlock to ssl without padlock
- Redirect HTTP to HTTPS
- Change gravity forms confirmation redirect query string to include entry id [closed]
- How to redirect visitor to a custom URL using PHP code in functions.php
- Redirect away from login page
- Deny access to a path (give 403 or 404 response)
- Redirect home to another page with htaccess
- How do I redirect /search/ to ?s=
- Infinite loop behind SSL proxy on non-standard port
- Redirect if $_Server[‘REQUEST_URI’] is /wp-login.php?checkemail=registered
- set up 301 redirect within wp-content/uploads/ directory of a WP site to a new image URL
- How to redirect user after login to a specific page?
- .htaccess rule to redirect old URLs to new structure [closed]
- How can I redirect a URL to an anchor link while maintaining the URL?
- How to remove duplicate and unnecessary part in a url using htaccess and regex?
- Built-In Postname Redirection vs Hard Redirects in relation to SEO and performance
- Masked a external URL and redirection plugin
- Redirect “http://old.net/category/postname” to “https://new.com/postname”?
- Image URLs not redirecting properly
- After logout browser’s back button into twenty sixteen theme profile
- URL masking of subdomain to main domain using .htaccess
- Redirect outside WP after login
- Redirect non existing page to frontpage
- How do I do a redirect to WordPress permalink with post id via htaccess?
- WP page 404 error only on mobile
- How to prevent redirect 301
- Redirect one domain to another
- How to redirect wp_login_form to new page after user loged in?
- How to redirect multiple subfolders back to root domain?
- How do I Redirect Tags from Old Joomla Site to New WordPress Site?
- How to redirect user after login to the page called by his first name?
- Redirect After Login Error
- Redirect after get_delete_post_link
- Whenever I try to publish a post in wordpress, I always get redirected to the installation page…why?
- Is it possible to detect if a POST action is for a “Save Post” before the save_post action?
- Login redirect to previous page
- Disable and Hide WP-JSON
- URL redirection
- Old missing file in wp-content/uploads/ returns a 500 error, how to catch and redirect?
- Browsers Forcing Multisite to https
- Is it possible to change redirect template through a shortcode?
- How do redirect user back to previous page when on certain pages?
- Relink Drupal Permalinks “…node/XXXX” to wordpress Permalinks (e.g./audio/)
- Hide a Post everywhere except on redirect
- How to 301 redirect WP posts id “/c/94940894” to permalink with post name?
- WP 301 redirect does not work
- Redirect Image URL to it’s parent post
- Redirect user if they are logged in
- WordPress Redirect post to outside website based on useragent
- WordPress site not forcing from http to https instead getting redirected too many times
- Redirect not work
- There is 1 redirect
- Redirect to custom admin menu after plugin activation
- Redirect HTTP request to HTTPS request
- All new posts serving 301 redirect
- home page redirect loop after update to 4.8
- Moving site from HTTP to HTTPS
- Redirect from plugin created page
- Woocommerce login to specific page or referrer
- How is this URL being redirected?
- What’s the best way to redirect to a new wordpress website?
- Tag archive page not working
- 301 Redirect only for posts
- Custom redirects with using SQL
- Redirect after user changes password
- Getting error when trying to redirect WP site to mobile site
- Custom Form Redirects to Post after Submit
- wp_login_form: Redirect to dynamic url according to username
- Plugin redirects URL structure using 301 redirect. Time to disable the plugin?
- Plugin html-on-pages: URL not redirecting
- Hide page for user logged and redirect for profile? [duplicate]
- Redirect URL while building site
- Redirect a WP to another with all URL
- Redirect ignore last URL segment
- Creating custom link that redirects to a another link
- Other pages fine but wp-admin showing ERR_TOO_MANY_REDIRECTS Error
- How to disable login and registration pages?
- After migration index page still redirects to old url