How do I add a add_rewrite_rule without it redirecting?

In your rewrite rule, pagename should in fact be the query_var of your custom post type. Unless you used query_var => 'something_else' in your register_post_type arguments, it’ll be the same name as your custom post type:

index.php?locations=$matches[2]

Leave a Comment

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