WP URL Re-writing plugin

sAndrewLobanov

New Member
I am trying to integrate a few non-wordpress PHP pages into an existing Wordpress site. Ideally, I want to rewrite anything request that looks like this: 'domain.com/books/bookname' to 'domain.com/catalog.php?title=bookname'. I have been messing around with the WP Rewrite API for several hours, but I just can't get anything to work. Here is my current plugin code:\[code\]register_activation_hook( __FILE__, 'wbm_catalog_activate' );function wbm_catalog_activate() { wbm_catalog_add_rules(); flush_rewrite_rules();}// Flush when deactivatedregister_deactivation_hook( __FILE__, 'wbm_catalog_deactivate' );function wbm_catalog_deactivate() { flush_rewrite_rules();}add_action( 'init', 'wbm_catalog_add_rules' );function wbm_catalog_add_rules() { add_rewrite_rule( 'books/([^/]+)/?', 'catalog.php?title=$matches[1]', 'top' );}\[/code\]I can even inspect the $wp_rewrite object and see my new rule added, but whenever I try to visit a rewritten url, wordpress acts as though the rule were not there.I have been banging my head up against a brick wall, and I would appreciate any help you could give!
 
Top