Can I keep part of my category base URL?

#272263
  • Resolved Gustavo Sartori
    Rank Math free

    Hello there! First of all, thank you in advance foi your answer. I’m glad i’m not alone here.

    My site use the following permalink structure:

    mysite.com/blog/%category%/%post-name%

    So I have URLs like this:

    mysite.com/blog/category/my-category/
    and
    mysite.com/blog/category/my-category/my-post-name

    When turn the Strip Category Base option on, my base uri /blog/ are stripped together whenever I try to reach any category.

    mysite.com/category-name/ instead of mysite.com/blog/category-name

    This behavior occur only in category URL, all posts URL keep the /blog/ URI.

    Is there a way to keep this /blog/ slug?

    What I’m trying here is to keep all blog post inside this ‘directory’ blog, so it won’t be at the same level as all institutional and commercial landing pages.

    I hope you guys can help me with that.
    (I’m sorry if was not able to clarify my issue. English is not my first language)

    Best regard o/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    I’ve checked your site, and it seems that you’re currently using Yoast. Please let us know if we can modify the plugins on your live site.

    Alternatively, you can create a staging site with the same issue as it seems that your site is currently live. This will also avoid your site getting any unexpected issues upon disabling plugins or switching themes.

    Here is a guide that could be really useful for you on how to create a staging site: https://www.wpbeginner.com/wp-tutorials/how-to-create-staging-environment-for-a-wordpress-site/

    Looking forward to helping you.

    Thank you.

    Yes! This is my stag site, so you can change anything you need.

    I have activated the YOAST just to check if it have the same behavior, but it’s not the case.

    Yoast is capable to keep my /blog/ slug…

    Hello,

    This can be controlled directly from the permalinks structure of your website.

    If you disable the option to remove the base from our plugin and add the base to the categories in the permalinks, all links work as expected.

    We made those changes on your website and the categories are loading with the blog base as well as the posts according to the permalinks settings.

    Don’t hesitate to get in touch if you have any other questions.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    unfortunately it didn’t work as spected. Now my posts are returning status 404.

    I’ve updated the sensive data with two examples os post urls that’s returning 404, but it’s happening with all blog posts.

    Nigel
    Rank Math business

    Hello,

    I used the following settings:

    Custom Structure: /blog/%category%/%postname%/
    Category Base: blog/.
    Include the dot on category base.

    I hope that helps.

    Thank you so much for your support, but it isn’t working properly yet. Now the pagination of sub categories are not working. I’m getting a 404 status.

    can you check it?

    Hello,

    We appreciate the details.

    The Remove category base will remove the base which you have added in the Category base option in Permalink settings.

    WP itself doesn’t allow using the same base for Posts & Categories that’s why you are seeing a 404 error. Adding custom code is the only solution here but unfortunately, it is not covered in our support policy as it requires quite a lot of code. Moreover, it is not really something caused due to Rank Math.

    We recommend hiring a coder for this if you want or adding redirects manually.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)

The ticket ‘Can I keep part of my category base URL?’ is closed to new replies.