Michael Harris wrote:
> I'm hoping for advice as to the best way to achieve sub-page rewrites.
> I have little clue about rewrite rules.

In rewriterules.php:

array( 'name' => 'display_page', 'parse_regex' => 
'%^(?P<parentage>.*/)(?P<slug>[^/]+)(?:/page/(?P<page>\d+))?/?$%i', 
'build_str' => '{$slug}(/page/{$page})', 'handler' => 
'UserThemeHandler', 'action' => 'display_post', 'priority' => 100, 
'description' => 'Return page matching specified slug', 'parameters' => 
serialize( array( 'require_match' => array('Posts', 
'rewrite_match_type'), 'content_type'=>'page' ) ) ),


Note the addition of the <parentage> capture.

You'd need to change the require_match parameter to point to a function 
that would validate that the post with the requested slug is the type 
(page) required, and also that the value of parentage matches any needed 
parent slug values.

It might be more efficient to alter the Posts table slug field (and the 
code that supports it) to include the full URL, including the slashes.

Owen

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/habari-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to