• Hi,

    I have the following permalink structure for the articles:
    /a/%post-id%/%postname%/

    I also have installed yoast seo plugin.

    The problem I have is the links for the category are built this way
    /a/category-name wich is a 404 error. The correct link should be /category-name

    I have no idea why this is happening and why the link is being generated with kind of a param of the permalink of the posts (/a/).

    Any ideas? Thanks!

Viewing 15 replies - 1 through 15 (of 15 total)
  • You are putting the literal ‘a’ in your permalink…why??
    try changing the permalinks to

    /%post-id%/%postname%/

    Thread Starter dirital

    (@dirital)

    Hi,

    With that config it works well, I already tried that. But why the /a/ gets attached to the category permalinks?

    anything you put in your permalink other than the %…% strings will show up as part of the url. That is why the /a/ shows up.

    Now the reason you are having a problen is that you are using a dash instead of an underscore – you have %post-id% when it should be %post_id%

    BUT why are you even using post ID?

    Thread Starter dirital

    (@dirital)

    My mistake, is not /%post-id%/%postname%/ but /%post_id%/%postname%/

    BUT why are you even using post ID?
    This is a customer worpdress with a previous configuration. I wouldn’t use the id either, just the post name.

    anything you put in your permalink other than the %…% strings will show up as part of the url. That is why the /a/ shows up.
    But it shows up even in the category permalinks?

    The ‘a’ shows up because it is literally part of the permalink
    the word ‘category’ shows up because that is what is used inplace of the %post_id%
    if you go to an archive page, you will see ‘date’ in the %post_id% position

    Thread Starter dirital

    (@dirital)

    and why do you think the /a/category-name generates a 404 error when /category-name works correctly? Why the router is not able to manage the /a/ literal?

    Why the router is not able to manage the /a/ literal?

    Router?? A router is a piece of hardware and has nothing to do with this.

    Where are the bad links? can you provide a url that exibits the issue?

    Thread Starter dirital

    (@dirital)

    router/url resolver. Sorry, using the symfony terminology https://symfony.com/doc/current/book/routing.html

    example:
    category: technology

    url generalted in the links: /a/technology and that generates a 404 error.

    But if I go to /technology I can see the category correctly

    Can you provide the url that exibits the issue so I can see it?

    Thread Starter dirital

    (@dirital)

    mediatrends.es/a/informatica

    What happens if you disable the yoast seo plugin?

    Thread Starter dirital

    (@dirital)

    same problem, just tried

    So this is in the MENU that the problem occurs. How is the menu created? Is it an automatic menu generated by the theme or is it a custom menu?

    If it is made by the theme then is is going to be a theme issue.

    Test this out by adding the category widget to the site and see if that works.

    Thread Starter dirital

    (@dirital)

    good point. I just checked, it doesn’t look a theme issue thought, in wp-admin the category links are also generated with the /a/ prefix

    Did you try adding in the category widget toa sidebar and testing that?

    the /a is not the problem, it is the missing word ‘category’ – although I just tested using https://www.mediatrends.es/category/informatica/ but it gets rewritten to https://www.mediatrends.es/informatica/ which points at your htaccess file.

    you need to go back to basics.
    1) disable ALL plugins
    2) change the permalinks to the default
    3) do the links work? if the answer is yes continue

    4) change the pemalinks to /%post_id%/%postname%/
    5) do the links work? if the answer is yes continue

    6) change the pemalinks to /a/%post_id%/%postname%/
    7) do the links work? if the answer is yes continue

    8) activate all the plugins
    9) do the links work?
    — if the answer is no, the cause is a plugin.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Error building the category permalinks’ is closed to new replies.