WordPress custom posts and permalinks

Try something similar to this:

function custom_rewrite( $wp_rewrite ) {
    $feed_rules = array(
        '(.+)/([^/]+)(/[0-9]+)?/?$'    =>  'index.php?post_type=".$wp_rewrite->preg_index(1)."&custom_taxonomy='. $wp_rewrite->preg_index(2).'&post_name=". $wp_rewrite->preg_index(3)
    );

    $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
}
// refresh/flush permalinks in the dashboard if this is changed in any way
add_filter( "generate_rewrite_rules', 'custom_rewrite' );

You may need to modify the regex, as regex isn’t one of my strongpoints, and you’ll need to swap out your taxonomy name in the URL. You may want to hardcode the custom post type too and adjust the rest accordingly to avoid clashes.