From 44e471be5c8642baad099a2828f6aca229e3aaec Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Mon, 8 Dec 2003 09:29:47 +0000 Subject: [PATCH] mod_rewrite code for new category URIs. git-svn-id: https://develop.svn.wordpress.org/trunk@592 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/wp-options-permalink.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wp-admin/wp-options-permalink.php b/wp-admin/wp-options-permalink.php index f05fb69c7e..cbc2277ed0 100644 --- a/wp-admin/wp-options-permalink.php +++ b/wp-admin/wp-options-permalink.php @@ -135,10 +135,16 @@ for ($i = 0; $i < count($tokens[0]); ++$i) { } +// Code for nice categories, currently not very flexible +$front = substr($permalink_structure, 0, strpos($permalink_structure, '%')); + $catmatch = $front . 'category/'; + $catmatch = preg_replace('|^/+|', '', $catmatch); + ?>

RewriteEngine On
RewriteBase
- RewriteRule ^ [QSA]

+ RewriteRule ^ [QSA]
+ RewriteRule ^(.*) index.php?category_name=$1 [QSA]