I have a WordPress blog and I’ve discovered some links coming from other sites are going to a 404 page even though they should work. When I first setup the WP site, I didn’t use rewritten URLs, but a couple years ago I instituted pretty urls using the wp-admin Permalinks section to do so. The incoming links that aren’t working were posted (I assume) before the rewritten urls were put in place. Since this is a bit difficult to explain, please see below for what works and what doesn’t.
One such example of a URL that is broken is: http://www.jerrytravis.com/?p=331&cpage=1
Going to this page redirects to http://www.jerrytravis.com/comment-page-1 , which redirects to 404 because the redirected page actually does not exist.
If I omit the cpage query string parameter, as in http://www.jerrytravis.com/?p=331, it redirects fine to the pretty-url style post.
My custom permalink rule is /%post_id%/%postname% and it works perfectly most of the time, but apparently cpage isn’t being handled properly.
What mod_rewrite rule could I add to .htaccess (that won’t break my existing custom permalink rule) so that http://www.jerrytravis.com/?p=331&cpage=1 would redirect to http://www.jerrytravis.com/331/comment-page-1 (which works fine and takes into account comment pagination)?
- The topic ‘WordPress query string with cpage parameter results in 404 error and wrong redir’ is closed to new replies.