• Hope someone can help me with this issue:
    I had set the following permalink structure: /%pagename%, which worked fine, also with subpages, as the url-bar correctly displayed pagename/subpagename. However, the single posts could not be viewed; clicking on a posttitle in a (static) postpage (you know, all the posts displayed ordered by date of publishing) displayed the 404 error page. I then changed the permalink to /%pagename%/%postname%, which fixed the problem of the posts – single posts were now viewable, but then the page with subpages generated a 404 error page..

    Hence, my question is: Which permalinks structure or syntax is correct when I want to display single posts AND pages with subpages?

    For the record: everything works fine when I set the permalinks to default or ‘ugly’ structure or syntax.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi elektronicat

    /%category%/%postname%/
    is the best permalinks structure when display single posts AND pages with subpages.

    Except that the WP Codex says

    Starting Permalinks with %category% is strongly not recommended for performance reasons.

    Thread Starter elektronicat

    (@elektronicat)

    I see.. I won’t be using categories, so just setting the permalink to /%postname% would be sufficient, and it works for both single posts and pages with subpages. The only downside with this permalink structure is that the url won’t be including the parent page from where it originated from (in my case ‘News’) The only messy (visual) fix is to make a category named ‘News’ and use the /%category%/%postname%/ structure altogether. That way ‘News’ will be displayed, not as pagename but as categorie name.
    Unless, someone knows a cleaner, more valid, solution?

    I use /%post_id%/%postname%/
    Works fine for pages with sub-pages and has the added benefit (for me) I can use a shortlink for the post like mysite.com/333/ instead of the full mysite.com/333/i-love-custom-taxonomies

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Which permalink structure/syntax to use?’ is closed to new replies.