Complex rewrite rules with multiple variables, some the same

For those interested I got around it by doing the following add_rewrite_rule( ‘members/search/(.+?)?$’, ‘index.php?page_id=’ . $member_page_id . ‘&search=$matches[1]’, ‘top’ ); So essentially getting everything after the search then dealing that when parsing the query I then parsed the query like so from the ‘search’ query_var function wpse_set_pre_get_users( $query ){ if( ! is_admin() ){ $meta_query = … Read more

How to add rewrite rule to point to file

add_rewrite_rule should choose where to write your rules to internal array of rewrite_rules or to .htaccess. If I understand logic behind this code SSLA_PLUGIN_URL is something like http://www.example.com/wp-content/plugins/plugin/… in this case you should check your .htaccess (in case if you using apache), because all external rules goes there. You can continue to debug your redirections … Read more

How to change URL in WordPress

It is atypical to edit .htaccess for custom rewrite rules, usually there is no need. WP works on passing everything to its PHP core and sorting it out there. For your specific use case I suspect you would have better lack using rewrite endpoint. It is quite robust way to handle an extra level in … Read more