douludi8413 2014-07-19 23:14
浏览 47
已采纳

将WordPress主页URL设置为付费会员专业版检出页面并重写/隐藏URL

The Problem:

  1. Set the home page of WordPress to a specific Paid Memberships Pro checkout page (I don't want this to be done via a custom page template). Example:

    User visits: http://www.example.com/

    They're redirected to: http://www.example.com/membership-account/membership-checkout/?level=1

  2. HIDE the URL, so that it reads simply as:

    http://www.example.com/ (the user never knows they've been redirected to a different page template)

What I've tried:

  1. Set the home page to /membership-account/membership-checkout/ via the admin (this url is missing the query string ?level=1). Doesn't work because I'm trying to target this specific membership level. Site redirects to /membership-account/membership-levels/

  2. Modify .htaccess to Redirect the user to the desired page, and then RewriteRule back to the root domain...results in a redirect loop error.

Thoughts for how to approach this?

  • 写回答

2条回答 默认 最新

  • duanchuaiwan0063 2014-07-20 19:20
    关注

    PMPro developer here. The checkout page requires that ?level=1 parameter or it will try to redirect to your levels page.

    There are a few ways to override this behavior by basically telling PMPro which level to assume on the checkout page if none is given. Here is one option, add this to your wp-config.php, active theme's functions.php, or a custom plugin:

    define("PMPRO_DEFAULT_LEVEL", "1");

    Alternatively, you can set $_REQUEST['level'] in some code directly.

    Hope this helps.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 fluent的在模拟压强时使用希望得到一些建议
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退