[wp-hackers] needs testing and feedback: small patch for nicepermalinks on lighttpd

Michel Valdrighi michelv at gmail.com
Wed Mar 16 16:33:27 GMT 2005


Le mercredi 16 mars 2005 à 09:29 -0500, Mark Jaquith a écrit :
> I'm not familiar with this style of rewrite, but it seems to me that you 
> could do this and consolidate it into one:
> 
> url.rewrite = ( "^/(page|comments|search|feed)/(.+)$" => 
> "/index.php/$1/$2" )

That's what I came up with this morning for this test blog:
http://zengun.org:8888/wpsvn/trunk/

Ideally and for the sake of clarity, we would need two or three rewrite
rules at most:
- one for built-in URLs like /search, /archives, /feed...
- possibly one for plugins, since plugins can add their own rewrite
rules
- one for pages, to distinguish them from built-in rewrite rules

These lighttpd rewrite rules could be generated by a plugin that would
work with permalinks-options. Once the rules are updated, the plugin
could compute the rewrite rules, and display them in the admin interface
in a <div class="updated">.
The computation could easily be done by blindly getting all first words
after "^" and before "/" on each line, excluding words surrounded by
parenthesis first, then excluding those without parenthesis. It would
catch "archives", "category", possible plugin stuff and so on in the
first pass, then pages in the second pass.

Just throwing these ideas around. I'll probably code this plugin for my
own use and convenience for when I'll switch to lighttpd, but feel free
to beat me to the punch. :)

-- 
Michel Valdrighi
http://zengun.org/weblog/



More information about the wp-hackers mailing list