最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugin development - Wordpress Custom URL

programmeradmin0浏览0评论

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\/(Z\d*)','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*)_(Z\d*)

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

The Final URL looks like :

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

can anyone help me?

发布评论

评论列表(0)

  1. 暂无评论