• Resolved cesbloggan

    (@cesbloggan)


    Hi,
    I have changed the permalinks in the Settings to show pages rather than the default. I did it by adding /pages to the custom field, which may be wrong I don’t really know.

    It works fine for my pages though, showing addresses like this:
    https://www.mydomain.com/about/history/

    I also added a structure for the category base which makes WP find my posts when clicking a category link.

    However, WP can’t find posts when I click on the link to the posts themselves because then the link becomes: https://www.mydomain.com/pages
    and of course that isn’t correct.

    Is there a very simple way to correct this that I am overlooking?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Add /%postname%/ or /pages/%postname%/

    WordPress must know what post to query

    Thread Starter cesbloggan

    (@cesbloggan)

    Thanks a lot!
    I actually tried another way sort of like that but it didn’t work.

    But, now everything is found without problems. However, the posts themselves get a quite ugly address: https://www.mydomain.,com/pages/hello-world/
    Is there a way to get around that?

    Don’t add pages, add only /%postname%/

    Thread Starter cesbloggan

    (@cesbloggan)

    OK, thanks a bunch!
    It was that simple..

    Alwyn Botha

    (@123milliseconds)

    https://codex.www.ads-software.com/Using_Permalinks

    For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text “page slug” as the URL), and to compensate, WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties). So, it is best to have at least two path segments in your post’s permalink structure such as /%year%/%postname%/ or even /posts/%postname%/. (Some people recommend /%post_id%/%postname%/ which works for performance reasons but others recommend against it because it is unfriendly to users in the many contexts in which users interact with URLs.)

    Thread Starter cesbloggan

    (@cesbloggan)

    Interesting, but how would I go about changing my post and page structure then?
    I added:
    news/%postname%/
    which works fine as well. I actually have the posts on a “News”-page and by adding “news” in front of %postname% it shows that instead of “posts” on the posts-pages but the pages remain the same.

    Is that a better way of doing it or is adding news instead of posts actually making it another text-field as you say?

    Alwyn Botha

    (@123milliseconds)

    >>Is that a better way of doing it or is adding news instead of posts actually making it another text-field as you say?

    Starting with posts vs news are probably identical performance wise;

    >>>it is not a good idea to START your permalink structure with the postname

    When you START permainks with post or news or zcy321 or mamma you are ok.

    Thread Starter cesbloggan

    (@cesbloggan)

    OK, thanks!
    I did understand when you gave me the idiot-proof written advice ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Permalinks don't work for pages AND posts’ is closed to new replies.