【问题标题】:How to pass a query string to another page on the same website?如何将查询字符串传递到同一网站上的另一个页面?
【发布时间】:2017-01-07 07:58:38
【问题描述】:

我正在使用一个使用unique user ids (uuid) 的插件来让访问者访问一些信息。他们通过电子邮件收到此信息。整个系统基于wordpress。

如果访问者使用包含查询字符串的 url 打开直接页面,这很好用,例如:

https://www.example.com/user_site/?uuid=237237

一旦用户打开链接并导航到另一个页面,然后可能是它的 user_site,查询字符串就会丢失。它显示在这个例子中:

打开网址的历史记录:

  1. https://www.example.com/user_site/?uuid=237237

  2. https://www.example.com/another_site - 错误,查询字符串丢失

  3. https://www.example.com/user_site - 无法访问,这家伙到底是谁?!

当用户停留在网站上时,如何更改并传递(或解析)查询字符串?或者我什至可以缓存它吗?我可以使用php.htaccessjavascriptjQuery 来实现这一点。

历史应该是怎样的:

  1. https://www.example.com/user_site/?uuid=237237

  2. https://www.example.com/another_site/?uuid=237237- 很好,还是知道你是谁

  3. https://www.example.com/user_site/?uuid=237237 - 太好了,进来

【问题讨论】:

  • “打开另一个站点后” - 您的意思是您导航到一个完全不同的站点,然后通过其他链接、书签或返回按钮再次返回?
  • 抱歉,这具有误导性。我已将其更改为“另一个页面(同一域)”。从完全不同的站点返回后,我猜只能通过使用缓存插件来解决?

标签: php jquery wordpress .htaccess


【解决方案1】:

试试这个:var sections = window.location.split('=')

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多