<?php
/*
Instead of editing .htaccess, adding this to functions.php
in a theme allows you to add rewrite rules. Remember to update
permalinks settings to activate any changes to these rules.

Syntax: add_rewrite_rule($rule, $rewrite, $position);

Details: http://codex.wordpress.org/Rewrite_API/add_rewrite_rule

NOTE: If you add custom query variables, you'll need to
register them using add_rewrite_tag()
*/

// Used with a custom post type
add_rewrite_rule(
    'events/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})$',
    'index.php?post_type=events&year=$matches[1]&month=$matches[2]&day=$matches[3]',
    'top'
);