Page 1 of 1

category and post links

Posted: Mon Oct 31, 2005 10:14 pm
by odyseusz
hi
can you tell me how to:
change category link from domain.com/categories/my_category/
to domain.com/my_category/ ????

and posts links from domain.com/archives/post_name to domain.com/category_name/post_name ????

Posted: Tue Nov 01, 2005 3:47 am
by judebert
I tried to do exactly that through Serendipity configuration, and ran into loads of trouble.

The problem was that s9y uses its configuration to modify your .htaccess rewriting rules. If you don't include a subdirectory specifying categories, s9y writes a rule like "/anything gets mapped to /index.php?cat=anything".

If you want those URLs to redirect to a category listing, your best bet is to simply write your own rewriting rules; you'll need multiple rules, like "/cat1 gets mapped to /index.php?cat=cat1; /cat2 gets mapped to /index.php?cat=cat2; etcetera".

If you want s9y to use those URLs itself, well... I believe an event plugin would be necessary.

You could try using the s9y configuration, then manually modifying the rewriting rules. It'd need to be remodified every time you modified the categories, and any time the path configuration changed, but otherwise I believe it would work.

Posted: Thu Nov 03, 2005 9:20 am
by garvinhicking
Serendipity does support creating custom permalinks, but you need directories for each ruleset, so you cannot simply redirect domains to use "/" as the path, but you need "my_categories/Category1" or so, with a constant "my_categories" prefix. Else, Serendipity couldn't decide whether you want to open an article, a feed, a category, an author or what else. The dir prefix really is a good thing to have, also for Visitors.

Best regards,
Garvin