doutan4831 2014-12-03 09:20
浏览 49
已采纳

重写woocommerce我的帐户,登录并注册url到子域名

I have a wordpress site with woocommerce installed on it. I want to rewrite its login, register and my account urls to subdomains.

E.g.
main site: example.com
login url: account.example.com/login
register url: account.example.com/register
my account url: account.example.com/my_account

I have mapped the subdomain and currently these urls are working fine but I am facing two issues:

  1. I am unable to change the default urls
  2. Cookies on main domain are not working on subdomain
  • 写回答

1条回答 默认 最新

  • dongzhouzhang8696 2014-12-05 06:00
    关注

    For cookies I added following in my wp-config.php and it worked like a charm:

    define('COOKIEPATH', '/');
    define('COOKIE_DOMAIN', 'lootlo.pk');
    

    For urls issue after lots of searching and not getting any proper solution I changed the urls in my themes header file and also added a 301 redirection code to redirect to subdomain if any of these urls accessed without subdomain.

    I also added a code for redirecting other urls to main domain if accessed through subdomain.

    I do not think its a proper solution but it is serving my purpose.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换