Viewing 4 replies - 1 through 4 (of 4 total)
  • You could either add a 404.php to your theme that redirects to your homepage and/or you could manually 301 redirect each url by editing your .htaccess

    Example:

    Redirect 301 /wordpress_folder_name/?p=221 https://www.domain_name.com/YYYY/MM/DD/post-title/

    You can set that up in your .htaccess file, if you have the ability to edit that. You can add this code to the very end of the file:

    Redirect /wordpress_folder_name/?p=221 https://www.domain_name.com/YYYY/MM/DD/post-title/

    Thread Starter davidthornton

    (@davidthornton)

    Hmm… The .htaccess redirect seems to only work to point to a specific directory. Since WordPress doesn’t actually create a directory for a post, the redirect fails. Maybe I’ve got the syntax wrong? Should there be a carriage return between the old link and the correct link, or will a space work just as well?

    The domain name points to the root of the WordPress directory, so I shouldn’t have to specify a folder… Or should I?

    I tried "Redirect /?p=189 /?p=191" which gives a 500 Internal Server Error page.
    I also tried "Redirect https://www.domain_name.com/?p=189 https://www.domain_name.com/?p=191" which gives a “Sorry, no posts were found” page. Just like not having a redirect there at all.

    Post #191 is where I want the /?p=189 links to point. If I put https://www.domain_name.com/?p=191 into a browser, it pulls the page up just fine, but https://www.domain_name.com/?p=189 gives the “Sorry…” error page.

    I’ve also set up a 404 that includes links, but lots of people hitting that don’t appear to move past that to go to the correct page. I’m wondering if putting pictures in there would help.

    There should not be a carriage return, David. It should all be on one line with a space in the middle.

    Just try “Redirect /?p=189 https://domainname.com/?p=191”

    In other words, the relative directory for the first item and the full URL for the second. Not sure if this is necessary or not but it’s the way I do it and it always works like a charm.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Post Redirects?’ is closed to new replies.