0

As from a link of the form:

http://testsite/city/sochi/?listing_type=apartment

I can get http://testsite/city/sochi/apartment

The method provided below does not work for me, what is my mistake?

function custom_rewrite_rules() {
    flush_rewrite_rules();
    add_rewrite_rule('^city/(.*)/(.*)?', 'index.php?city=$matches[1]&listing_type=$matches[2]', 'top');

}
add_action('init', 'custom_rewrite_rules');

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.