WordPress Custom URL

i have a self coded plugin with a rewrite rule

function custom_rewrite_rule1() {
// add_rewrite_rule(‘^([^/]+)/?’,’index.php?page_id=$matches[1]&page=$matches[2]&memberID=$matches[3]&land=$matches[4]&fa=$matches[5]&vorname=$matches[6]&nachname=$matches[7]’,’top’);
//add_rewrite_rule(‘userprofile/(Zd*)’,’index.php?p=451&memberID=$matches[1]’,’top’);
add_rewrite_rule(‘userprofile/(w*)/(w*)/(w*)/’, ‘index.php?page_id=451&land=$matches[1]’,’top’);
//userprofile/(w*)/(w*)/(w.)_(w*)_(w*)_(Zd*)

//add_rewrite_rule(‘userprofile/(w*)/(w*)/(w.)_(w*)_(w*)_(w*)_(Zd*)’, ‘index.php?page_id=451&land=$matches[1]&memberID=$matches[6]’,’top’);
add_rewrite_rule(‘userprofile/(w*)/(w*)/(w._)?(w*)_(w*)_(w*)_(Zd*)’, ‘index.php?page_id=451&land=$matches[1]&memberID=$matches[7]’,’top’);
}

The Final URL looks like : http://domain.com/userprofile/germany/dentist/firstname_lastname_memberID

but i need to get the userprofile removed from the url, this is the PageName!

can anyone help me?

Read more here:: WordPress Custom URL

Leave a Reply

Your email address will not be published. Required fields are marked *