mod_rewrite code for new category URIs.

git-svn-id: http://svn.automattic.com/wordpress/trunk@592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2003-12-08 09:29:47 +00:00
parent fc6bbfbebb
commit 15d636dcb5
1 changed files with 7 additions and 1 deletions

View File

@ -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);
?>
<p><code>RewriteEngine On<br />
RewriteBase <?php echo $site_root; ?><br />
RewriteRule ^<?php echo $match; echo '$ ' . $site_root . $query ?> [QSA]</code></p>
RewriteRule ^<?php echo $match; echo '$ ' . $site_root . $query ?> [QSA]<br />
RewriteRule ^<?php echo $catmatch; ?>(.*) <?php echo $site_root; ?>index.php?category_name=$1 [QSA]</code></p>
</div>
<?php
} else {