1. <tfoot id='mn2AI'></tfoot>
  2. <legend id='mn2AI'><style id='mn2AI'><dir id='mn2AI'><q id='mn2AI'></q></dir></style></legend>

      • <bdo id='mn2AI'></bdo><ul id='mn2AI'></ul>

      <small id='mn2AI'></small><noframes id='mn2AI'>

    1. <i id='mn2AI'><tr id='mn2AI'><dt id='mn2AI'><q id='mn2AI'><span id='mn2AI'><b id='mn2AI'><form id='mn2AI'><ins id='mn2AI'></ins><ul id='mn2AI'></ul><sub id='mn2AI'></sub></form><legend id='mn2AI'></legend><bdo id='mn2AI'><pre id='mn2AI'><center id='mn2AI'></center></pre></bdo></b><th id='mn2AI'></th></span></q></dt></tr></i><div id='mn2AI'><tfoot id='mn2AI'></tfoot><dl id='mn2AI'><fieldset id='mn2AI'></fieldset></dl></div>

      重写包含问号的 URL

      Rewriting URL that contains question mark(重写包含问号的 URL)
        • <tfoot id='4hMQd'></tfoot>
            <i id='4hMQd'><tr id='4hMQd'><dt id='4hMQd'><q id='4hMQd'><span id='4hMQd'><b id='4hMQd'><form id='4hMQd'><ins id='4hMQd'></ins><ul id='4hMQd'></ul><sub id='4hMQd'></sub></form><legend id='4hMQd'></legend><bdo id='4hMQd'><pre id='4hMQd'><center id='4hMQd'></center></pre></bdo></b><th id='4hMQd'></th></span></q></dt></tr></i><div id='4hMQd'><tfoot id='4hMQd'></tfoot><dl id='4hMQd'><fieldset id='4hMQd'></fieldset></dl></div>
              <tbody id='4hMQd'></tbody>

            • <bdo id='4hMQd'></bdo><ul id='4hMQd'></ul>
              <legend id='4hMQd'><style id='4hMQd'><dir id='4hMQd'><q id='4hMQd'></q></dir></style></legend>

                <small id='4hMQd'></small><noframes id='4hMQd'>

                本文介绍了重写包含问号的 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我遇到了有关 URL 重写的问题.我正在使用 Apache 的 mod rewrite 来重写 URL.比如我改写网址

                I am encountering a problem regarding URL rewriting. I am using Apache's mod rewrite to rewrite URLs. For example, I rewrite URL

                • www.website.com/some/path/
                • request.php?string=some/path/.

                然后我显示此 URL 的特定响应.现在我的重写规则是这样的:

                Then I show specific response for this URL. Right now my rewrite rule looks like this:

                RewriteRule ^([a-z_/?]+)$ request.php?string=$1
                

                但是如果我有 URL www.website.com/some/data/?id=12&name=John 并重写它,问题就会开始,我得到这样的东西:request.php?string=some/data/?id=12&name=John.在这个例子中,另一个问号似乎混淆了 PHP.如果我尝试在 request.php 中检索 $_GET['string'],我得到的只是:some/data/.

                But the problem begins if I have URL www.website.com/some/data/?id=12&name=John and rewrite it, I get something like this: request.php?string=some/data/?id=12&name=John. It seems that in this example another question mark confuses PHP. If I try to retrieve $_GET['string'] in request.php all I get is: some/data/.

                为了进一步参考,Gmail 对其网址做了类似的处理:
                https://mail.google.com/mail/?ui=1&shva=1

                For further reference, Gmail does something similar with it's URL:
                https://mail.google.com/mail/?ui=1&shva=1

                推荐答案

                我建议(作为 mario)查看 QSA 标志(查询字符串附加).另外,我会从正则表达式中的字符类中去掉问号:

                I suggest (as mario) to take a look into the QSA flag (Query String Append). Additionally I would take the question-mark out of the character class in the regex:

                RewriteRule ^([a-z_/]+)$ request.php?string=$1 [L,QSA]
                

                这篇关于重写包含问号的 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                <i id='aqXgj'><tr id='aqXgj'><dt id='aqXgj'><q id='aqXgj'><span id='aqXgj'><b id='aqXgj'><form id='aqXgj'><ins id='aqXgj'></ins><ul id='aqXgj'></ul><sub id='aqXgj'></sub></form><legend id='aqXgj'></legend><bdo id='aqXgj'><pre id='aqXgj'><center id='aqXgj'></center></pre></bdo></b><th id='aqXgj'></th></span></q></dt></tr></i><div id='aqXgj'><tfoot id='aqXgj'></tfoot><dl id='aqXgj'><fieldset id='aqXgj'></fieldset></dl></div>

              1. <tfoot id='aqXgj'></tfoot>

                    • <bdo id='aqXgj'></bdo><ul id='aqXgj'></ul>
                          <tbody id='aqXgj'></tbody>
                        • <small id='aqXgj'></small><noframes id='aqXgj'>

                          <legend id='aqXgj'><style id='aqXgj'><dir id='aqXgj'><q id='aqXgj'></q></dir></style></legend>