• Resolved gregamer

    (@gregamer)


    Hi,

    I want to set custom url for my CPT. Currently (with Custom Rewrite Slug setting empty) the URL of a single CPT is like this:
    https://domain.com/cpt_tutorials/post-slug (where cpt_tutorials is slug of my custom post type).
    I would like it to change to:
    https://domain.com/free-tutorials/post-slug

    When I add “free-tutorials” into the “Custom Rewrite Slug” setting (on Edit post type page) all CPTs return the 404 page. My System->permalinks is set to /%postname%

    How can I set custom rewrite for a CPT posts?

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hi @gregamer

    That’s the proper way to set post type slug rewrite slugs.

    My question is if you also have a page named “free-tutorials” because if that’s a matching value, then chances are WordPress isn’t quite sure what to query for. Is “free-tutorials/post-slug” a post in a post type? Is “post-slug” a child page of the “free-tutorials” page?

    Thread Starter gregamer

    (@gregamer)

    Hi,

    that’s weird. I tried different meaningful rewrites and they didn’t work. Now I typed some gibberish and it works. There is obviously something in the database with the slug I want to rewrite to although I can’t find anything similar in posts or pages. I’ll have to take a look in the db to find it.

    Thank you for your help, you deserve a 5 star ??

    Cheers,
    Grega

    • This reply was modified 9 months, 1 week ago by gregamer.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Setting “Custom Rewrite Slug” gives 404’ is closed to new replies.