• Hi,

    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

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Mads Phikamphon

    (@madsphi)

    I have tried to do add_action() for 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.

    Thread Starter Mads Phikamphon

    (@madsphi)

    Solution found, just add this to the code:
    https://biostall.com/prevent-wordpress-redirecting-to-nearest-matching-url/

    Thanks for the hint to

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Url changes to ?post_type=’ is closed to new replies.