• Resolved dwayneblee

    (@dwayneblee)


    I’ve recently overhauled a very old website which for some reason had preferred to use raw pageid URLs (site.com/?p=2032).
    We changed to pretty URLs using slugs and did a full content audit, consolidating duplicated content and making the structure logical. Now we’d like to redirect anyone using those old pageid URLs to the content’s new location. Just putting the old pageid in to 301 doesn’t seem to work. I’ve read that’s expected and that putting the new page slug in as the page to be redirected should work but not having success here either. I still get 404 errors in the log on pages I’ve set redirects for.
    i should mention that most of these pages are unpublished (but not deleted yet). The content was moved into the more appropriate custom post type which is now where I’m trying to redirect to.

    what is the best way to address the redirecting of old pageid URLs for pages that are no longer active?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Alexandru Tapuleasa

    (@talextech)

    If you want to redirect for example ?p=2032 then 2 things can happen:

    1. If there is a page/post/whatever CPT with that ID, then WordPress will first redirect it to that page’s permalink. If you then want 301 Redirects to redirect it, you will need to create a redirect from the page’s permalink instead of the page ID ?p=2032

    2. If no page with that ID exists, then you can just set ?p=2032 in the Redirect From of 301 Redirects and the redirect will work.

    Thread Starter dwayneblee

    (@dwayneblee)

    thanks for the reply. I agree that is what I expected to happen, however I’ve tried both methods (using the pageid and permalink) and I keep getting the same bug.

    The redirect is appending the redirected ?p=2032 on the end of the required new address. So if I use the drop down to select a post to redirect to the plugin gives the site URL with the selected posts ID after. So I’m getting

    Site.com/?p=4143/?p=2032 after redirection of the link site.com/?p=2032

    it’d work fine if that extra p=2032 wasn’t added on the end.

    I am also having this same issue. Any updates?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Redirecting pageid urls’ is closed to new replies.