• What happens when you edit the timestamp of a post? If you have “pretty” permalinks like the recommended
    archives/year/month/day/prettified-title-of-post/
    then the permalink will change according to the date – so it’s not really very perma at all, is it?
    Would a structure like
    archives/post_id/prettified-title-of-post/ not be better? This would also make the URI shorter and would avoid needlessly associating a post with (probably) irrelevant year/month/day numbers in the eyes of Google. (well it would still associate it with one random number, post_id. Better than three though).
    So I tried it on my blog. Results:
    – post title permalinks still work
    – category links still work
    – monthly archive links are borked, all months point to “mydomain.com/archives/”
    – calendar is broken big time. All dates with posts now link to “mydomain.com/arch” and even the link to the previous month is borked.
    Here’s my .htaccess file:
    RewriteEngine on
    RewriteBase /
    RewriteRule ^archives/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?category_name=$1&feed=$2 [QSA]
    RewriteRule ^archives/category/?(.*) /index.php?category_name=$1 [QSA]
    RewriteRule ^archives/author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?author_name=$1&feed=$2 [QSA]
    RewriteRule ^archives/author/?(.*) /index.php?author_name=$1 [QSA]
    RewriteRule ^archives/([0-9]+)?/?([_0-9a-z-]+)?/?([0-9]+)?/?$ /index.php?p=$1&name=$2&page=$3 [QSA]
    RewriteRule ^archives/([0-9]+)/([_0-9a-z-]+)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?p=$1&name=$2&feed=$3 [QSA]
    RewriteRule ^archives/([0-9]+)/([_0-9a-z-]+)/trackback/?$ /wp-trackback.php?p=$1&name=$2 [QSA]
    RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1 [QSA]
    RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1&withcomments=1 [QSA]
    Can anyone help me sort this out?
    Or convince me it’s a bad idea?
    Should it perhaps be considered for WP1.3?
    Oh and before you ask, of course the permalink also changes when a post title is changed. That’s why I think permalinks should include post_id, and retrieve posts from that because it’s the only attribute of a post that really never changes. So if one of my permalinks changes from “archives/post_id/old-title/” to “archives/post_id/new-title/” it would not matter because .htaccess magic would redirect “archives/post_id/anything-at-all” to the correct post.
    Am I making sense?

Viewing 2 replies - 1 through 2 (of 2 total)
  • In practice most people don’t ever modify their dates. When titles are modified in WordPress it keeps the original post slug unless you manually change it. In other words, you have to work to break a permalink. ??
    There are good arguments for using a post ID in your permalink structure, and you’re free to do so. In my opinion while this is more rigid it is less portable in the long-term. However if you do use the post ID there’s no reason to put the post slug cruft on the end, there’s no real benefit to anyone by doing that.

    Thread Starter zadu

    (@zadu)

    Oh, i thought the point of the slug cruft was to get more google love by having keywords present in the url?
    Is there a resource that explains how permalinks work, as opposed to a how-to? From your post it seems like WP retrieves posts by the post_id, except when there is no id, in which it retrieves them by the slug. Correct? (Sorry I’m too crap at regular expressions to tell from looking at the .htaccess)
    Is there a purpose to having the date form part of the URI?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Permalinks are not perma’ is closed to new replies.