mod_rewrite code for new category URIs.

git-svn-id: https://develop.svn.wordpress.org/trunk@592 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2003-12-08 09:29:47 +00:00
parent 46b58b378e
commit 44e471be5c

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 /> <p><code>RewriteEngine On<br />
RewriteBase <?php echo $site_root; ?><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> </div>
<?php <?php
} else { } else {