donglei2288 2017-02-08 19:30
浏览 39

当它包含会员ID时,重写wordpress登录URL

we are doing some affiliate tracking on a wordpress membership site with mod_rewrite. basically the URLS are domain.com/AFF_ID and AFF_ID is the members tracking id, this all works perfectly.

the problem comes in when members go to the affiliate tracked url domain.com/AFF_ID and login using domain.com/AFF_ID/wp-admin this generates a 500 error. rather than tell them not to use the affiliate id in the login URL i need to create a rule to remove everything before /wp-admin and the domain

basically

domain.com/could-be-anything/wp-admin

becomes

domain.com/wp-admin

i have tried various rules with no effect or i create an redirect loop. i would post what i have tried but they dont come close to working.

thanks for any suggestions,

Sean

  • 写回答

2条回答 默认 最新

  • duangai9678 2017-02-08 19:55
    关注

    You can try with this:

    RewriteEngine On
    RewriteRule ^([a-zA-Z0-9_-]+)/wp-admin$   /wp-admin [L,NC]
    

    It redirect any given path followed by /wp-admin to yourdomain.com/wp-admin
    ex.
    www.yourdomain.com/anything/wp-admin
    redirect to:

    www.yourdomain.com/wp-admin
    
    评论

报告相同问题?

悬赏问题

  • ¥100 iOS开发关于快捷指令截屏后如何将截屏(或从截屏中提取出的文本)回传给本应用并打开指定页面
  • ¥15 unity连接Sqlserver
  • ¥15 图中这种约束条件lingo该怎么表示出来
  • ¥15 VSCode里的Prettier如何实现等式赋值后的对齐效果?
  • ¥15 流式socket文件传输答疑
  • ¥20 keepalive配置业务服务双机单活的方法。业务服务一定是要双机单活的方式
  • ¥50 关于多次提交POST数据后,无法获取到POST数据参数的问题
  • ¥15 win10,这种情况怎么办
  • ¥15 如何在配置使用Prettier的VSCode中通过Better Align插件来对齐等式?(相关搜索:格式化)
  • ¥100 在连接内网VPN时,如何同时保持互联网连接