How to have a shorter URL for permalinks ?
-
Hi,
I ‘m using this as the template for permalinks in Options|Permalinks:
/archives/%year%/%monthnum%/%day%/%postname%/
This results in very long URLs for permalinks, which are wrapped (and broken) in most mailers. I’d like to refer to my posts (and offer links) with shorter URLs, but also keep the existing longer URLs for searching purposes.
Is it possible with the current rewrite rules generated by this template ? If it’s not, what additional rules would I need ? As you may have guessed, I’m not too good with regular expressions ?? Here’s my rewrite rules:RewriteEngine On
RewriteBase /wp/
RewriteRule ^archives/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp/wp-feed.php?category_name=$1&feed=$2 [QSA]
RewriteRule ^archives/category/?(.*) /wp/index.php?category_name=$1 [QSA]
RewriteRule ^archives/author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp/wp-feed.php?author_name=$1&feed=$2 [QSA]
RewriteRule ^archives/author/?(.*) /wp/index.php?author_name=$1 [QSA]
RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?/?([0-9]+)?/?$ /wp/index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/(feed|rdf|rss|rss2|atom)/?$ /wp/wp-feed.php?year=$1&monthnum=$2&day=$3&name=$4&feed=$5 [QSA]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/trackback/?$ /wp/wp-trackback.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA]
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /wp/wp-feed.php?feed=$1 [QSA]
RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /wp/wp-feed.php?feed=$1&withcomments=1 [QSA]
- The topic ‘How to have a shorter URL for permalinks ?’ is closed to new replies.