I have tried to rewrite the URl as http://example.com/book-appointment
For example
I have got a shop data by this url http://example.com/book-appointment/?shop=shop-name.
It should be work as same as url http://example.com/book-appointment/shop-name
I have tried
add_rewrite_rule('/book-appointment/([^/]*)', 'index.php?page_id=183&data=$matches[1]', 'top');
But it is not working as i write above
The full function, i have written
function custom_rewrite_basic() {
add_rewrite_rule('^booking-now/([0-9]+)/?', 'index.php?page_id=188&data=$matches[1]', 'top');
flush_rewrite_rules();
}
add_action('init', 'custom_rewrite_basic');
Put below code just after your function of add_rewrite_rule :
Check with this. Take the reference of this link you will get more clear idea.