Forums

Permalinks structure (12 posts)

  1. youthgas
    Member
    Posted 3 years ago #

    Hi everyone,

    Got a question about the use of permalinks. I was looking over the relevant page in the codex and it says it's best to start with a numeric field and end with postname.

    I was wondering if it was possible to use http://www.site.com/postname, where postname is actually only numbers, in this case the date. Is it the numeric field itself that is important or would only numbers in the postname field itself suffice?

    I am currently using http://www.site.com/year/postname, but would love to get rid of the year. On a side note, I tried this already and it cut off my ability to display comments, so there might not be much I can do about it anyway.

    Thanks in advance,
    Richard

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Why not use /%post_id%/%postname%/?

  3. youthgas
    Member
    Posted 3 years ago #

    I hadn't tried that. Thanks for the idea.

    Would love to just have postname, but eh...

  4. Gary Bairead
    Member
    Posted 3 years ago #

    Would love to just have postname, but eh...

    /%postname%/ will also work if thats what you want.

    If you are changing your url structure, watch out for 404 errors and set up redirects if necessary

  5. shvidky
    Member
    Posted 3 years ago #

    Gary, how do i fix that? Every time i change my permalinks to something else but default, I get 404 error. Anywhere I can read up on it? Thanks!

  6. youthgas
    Member
    Posted 3 years ago #

    Thanks Gary.

    I would like to, but the codex suggests there could be performance issues, but more so, using only postname doesn't display the comments page.

  7. Gary Bairead
    Member
    Posted 3 years ago #

    @youthgas: The performance issue with /%postname%/, according to the Codex: " has been changed and is ok to do since ver. 2.0". The comments problem seems a bit wierd.

    @shvidky: By 404 errors, I ment people coming from search engines might be sent to old urls, rather than the new structure. Your problem seems to be related to the .htaccess file in you root.

    Create a text file called .htaccess with the following code, and upload it to your root

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    http://codex.wordpress.org/Using_Permalinks#Where.27s_my_.htaccess_file.3F

  8. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    The performance issue with /%postname%/, according to the Codex: " has been changed and is ok to do since ver. 2.0

    No - it hasn't! In fact I checked into this again only recently. The potential performance issue still exists. I've now placed a strikethrough on that line of the relevant Codex page.

  9. youthgas
    Member
    Posted 3 years ago #

    Was going to try going back, but now won't.

  10. Gary Bairead
    Member
    Posted 3 years ago #

    @esmi: Cheers, for updating the Codex. Any links to more info on the subject?

  11. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    If you can cope with the tech-speak, there's a good discussion on the subject in the wp_tester's list archive. Look out for the posts by Otto. I spoke to him some weeks ago about this very subject and he confirmed that it's still an issue - especially if you're creating Pages as well as Posts.

    I do know that about 90% of the cases that I've seen where custom permalinks have been a problem, it's been in situations where people have been using /%postname%/ or /%category%/%postname%/

  12. Gary Bairead
    Member
    Posted 3 years ago #

    Thanks, I'll take a look.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags