• Using mod_rwrite to fake a static page hierarchy is a brilliant hack. Unfortunately I’ve had very bad experiences with the rules suggested by the options->permalinks menu.
    Here’s what I get:
    RewriteEngine On
    RewriteBase /
    RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([0-9]+)?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&day=$3&p=$4&page=$5 [QSA]
    RewriteRule ^archives/category/?(.*) /index.php?category_name=$1 [QSA]
    Notice that the first rule will fire on ^archives/.*, it just won’t return any match patterns. Thus all category searches return the default page. It’s easy enough to fix by putting the category rule first, but this needs t be done.
    Frank

Viewing 5 replies - 1 through 5 (of 5 total)
  • That’s odd, because that’s basicaly what I have…. and it works just fine….
    TG

    Just out of curiousity, what version of WP are you running? If I recall, I ran into a bug with the category rewrite rule in 1.0, but it was fixed when I upgraded to 1.0.1 and regenerated the rewrite rules.

    Thread Starter frankrichards

    (@frankrichards)

    I tried to upgrade to 1.0.1 but I’m not sure it worked. Is there a way I can check? Is there any problem with redoing the upgrade?
    I’ve not had any problems before or since except with the rewrite rules which basically don’t work.

    I think I see the problem. The fourth group (becomes $4) is not correct. Here is what it should be:
    RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([0-9a-z-]+)?/?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA]

    From what I can tell, he was only having a problem with the category rewrite rule…
    Frank: to check if your upgrade worked – check at the bottom of thep age in your admin pages… it should give you the version number for WP (says 1.0.1 once you upgrade)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘rewrite rules. suggested ones don’t work’ is closed to new replies.