0

I've got a post and a page with this slug: signatures-for-office-365 That's right, the same slug for a post and page.

Permalinks settings are: /news/%postname%/

When the post URL is requested, wp takes them to the page instead, like so:

Requested:/news/signatures-for-office-365

Result:/signatures-for-office-365

I've tried this:

add_action('init', function () {
 add_rewrite_rule('news/signatures-for-office-365/?$','index.php?name=signatures-for-office-365', 'top');
}, 1000);

I've tried this:

add_action('init', function () {
 add_rewrite_rule('news/signatures-for-office-365/?$','index.php?post_type=post&postid=17508', 'top');
}, 1000);

Both of which gives the URL I want, but the page displays the blog home instead. Outside of changing the slug to the post, any solutions? Thank you in advance.

2
  • I can't reproduce that behavior with a new install and default theme, verify that it's not a plugin or your theme causing this.
    – Milo
    Commented Jun 1, 2017 at 18:50
  • You might be onto something because this wasn't a problem for me with a local dev copy of the site. I'll see if I can check it out.
    – rpasillas
    Commented Jun 1, 2017 at 20:35

1 Answer 1

0

A simple way to fix this is to edit either the post or page, then change the permalink on the post/page to something unique.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.