Custom permalink variable on single post

Use add_rewrite_endpoint instead of adding a new rewrite rule:

function wpa_chapter_endpoint(){
    add_rewrite_endpoint( 'chapter', EP_PERMALINK );
}
add_action( 'init', 'wpa_chapter_endpoint' );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)