I have a page [ redundant link removed ] that for some reasons automatically redirects to a url with ?post_type=
.
The id matches a product-set with the name “Limab?nner”, so I suspect that the /lima/ matches the beginning of the product-set name and that’s the cause of the redirect.
But why is this happening and is there a way to override/stop it?
I have other /b/ pages that works fine, for example /b/bodylab/. Probably because there are no WP content that starts with the name “Bodylab”.
The /b/ pages are a way for my site to display content from a database, i.e. they are not part of the normal WP posts/pages.
Thanks,
Mads
init
and wp_loaded
– in both cases, the url is still /b/lima/
, i.e. the url/redirect to ?post_type=
happens after those two actions.
Here’s exactly how it goes:
init - url is /b/lima
wp_loaded - url is /b/lima
init - url is now ?post_type :(
wp_loaded - url is ?post_type
template_redirect - url is ?post_type
Note that template_redirect is never reached when the url is /b/lima
.
https://biostall.com/prevent-wordpress-redirecting-to-nearest-matching-url/
Thanks for the hint to
]]>