1. <small id='NYCt0'></small><noframes id='NYCt0'>

    • <bdo id='NYCt0'></bdo><ul id='NYCt0'></ul>
  2. <tfoot id='NYCt0'></tfoot>

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

      htaccess 删除 .php 并保留查询字符串

      时间:2023-10-13
        <tbody id='8w1Bl'></tbody>

          • <legend id='8w1Bl'><style id='8w1Bl'><dir id='8w1Bl'><q id='8w1Bl'></q></dir></style></legend>
                <bdo id='8w1Bl'></bdo><ul id='8w1Bl'></ul>

              • <small id='8w1Bl'></small><noframes id='8w1Bl'>

                <tfoot id='8w1Bl'></tfoot>
              • <i id='8w1Bl'><tr id='8w1Bl'><dt id='8w1Bl'><q id='8w1Bl'><span id='8w1Bl'><b id='8w1Bl'><form id='8w1Bl'><ins id='8w1Bl'></ins><ul id='8w1Bl'></ul><sub id='8w1Bl'></sub></form><legend id='8w1Bl'></legend><bdo id='8w1Bl'><pre id='8w1Bl'><center id='8w1Bl'></center></pre></bdo></b><th id='8w1Bl'></th></span></q></dt></tr></i><div id='8w1Bl'><tfoot id='8w1Bl'></tfoot><dl id='8w1Bl'><fieldset id='8w1Bl'></fieldset></dl></div>
                本文介绍了htaccess 删除 .php 并保留查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                这是我的 .htaccess 文件.

                Here is my .htaccess file right now.

                RewriteEngine On
                RewriteBase /
                RewriteCond %{REQUEST_FILENAME} !-f 
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteRule ^(.*)$ $1.php [NC,L,QSA]
                

                这样做的原因是它使我的页面在不使用 .php 扩展名时可以访问.

                This works in the fact that it makes my pages accessible when not using the .php extension.

                Old = domain.com/test.php
                New = domain.com/test
                

                不好的是,当我使用以下链接发送获取数据时,数据没有通过.我认为 QSA 选项可以做到这一点,这是怎么回事?

                The bad thing is that when I send get data with the following link the data is not passed. I thought the QSA option did that, whats the deal?

                domain.com/test?id=1
                

                推荐答案

                匹配整个查询字符串并使用反向引用将其附加到新 URL 应该可行.

                Matching the entire query string and appending it to your new URL using a back-reference should work.

                RewriteEngine On
                RewriteBase /
                RewriteCond %{REQUEST_FILENAME} !-f 
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteCond %{QUERY_STRING} ^(.*)$
                RewriteRule ^(.*)$ $1.php?%1 [NC,L,QSA]
                

                这篇关于htaccess 删除 .php 并保留查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:将 Javascript 数组传递给 PHP 文件 下一篇:请求 URI 太大

                相关文章

                  <bdo id='MEBzM'></bdo><ul id='MEBzM'></ul>

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

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