Permalinks are not perma
-
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?
- The topic ‘Permalinks are not perma’ is closed to new replies.