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

        <bdo id='3zQ4p'></bdo><ul id='3zQ4p'></ul>
      <legend id='3zQ4p'><style id='3zQ4p'><dir id='3zQ4p'><q id='3zQ4p'></q></dir></style></legend>

      <small id='3zQ4p'></small><noframes id='3zQ4p'>

      如何使用 .htaccess url 重写添加 .php 扩展名?

      How to add .php extension using .htaccess url rewriting?(如何使用 .htaccess url 重写添加 .php 扩展名?)
      • <bdo id='BVqoo'></bdo><ul id='BVqoo'></ul>
        <tfoot id='BVqoo'></tfoot>

        • <i id='BVqoo'><tr id='BVqoo'><dt id='BVqoo'><q id='BVqoo'><span id='BVqoo'><b id='BVqoo'><form id='BVqoo'><ins id='BVqoo'></ins><ul id='BVqoo'></ul><sub id='BVqoo'></sub></form><legend id='BVqoo'></legend><bdo id='BVqoo'><pre id='BVqoo'><center id='BVqoo'></center></pre></bdo></b><th id='BVqoo'></th></span></q></dt></tr></i><div id='BVqoo'><tfoot id='BVqoo'></tfoot><dl id='BVqoo'><fieldset id='BVqoo'></fieldset></dl></div>
        • <small id='BVqoo'></small><noframes id='BVqoo'>

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

                <tbody id='BVqoo'></tbody>

                本文介绍了如何使用 .htaccess url 重写添加 .php 扩展名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我在我的网站上设置了 .htaccess 文件,该文件将 SLUG 文本显示为 URL 中的页面名称,但没有扩展名.例如真实网址是

                I have set up .htaccess file on my website which display SLUG text as page name in URL but without extension. e.g. Real url is

                www.mywebsite.com/page.php?page=about-us
                

                然后通过url重写加载到下面的url

                Then it loads on below url through url rewriting

                www.mywebsite.com/about-us
                

                下面是我的 .htaccess 文件代码

                Below is my .htaccess file code

                Options +FollowSymlinks
                RewriteEngine On
                
                RewriteCond %{REQUEST_URI} !^.*(images/|.js|.css).*$ [NC]
                RewriteRule ^([a-zA-Z0-9_-]+)$ /page.php?page=$1
                

                现在我想在所有页面上显示 .php 扩展名,以便 url 应该如下所示

                Now I want to show the .php extension on all pages, so that the urls should be like below

                www.mywebsite.com/about-us.php
                

                我该怎么做?

                推荐答案

                Options +FollowSymlinks
                RewriteEngine On
                
                RewriteCond %{REQUEST_URI} !^.*(images/|.js|.css).*$ [NC]
                RewriteRule ^([a-zA-Z0-9_-]+).php$ /page.php?page=$1
                

                这篇关于如何使用 .htaccess url 重写添加 .php 扩展名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                Appending GET parameters to URL from lt;formgt; action(将 GET 参数附加到来自 lt;formgt; 的 URL行动)
                Forcing quot;Save Asquot; dialog via jQuery GET(强制“另存为通过 jQuery GET 对话框)
                PHP - get certain word from string(PHP - 从字符串中获取某个单词)
                How to debug a get request in php using curl(如何使用 curl 在 php 中调试 get 请求)
                get a # from a url in php(从 php 中的 url 获取 #)
                PHP - include() file not working when variables are put in url?(PHP - 将变量放入 url 时,include() 文件不起作用?)

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

                      <bdo id='lGpCo'></bdo><ul id='lGpCo'></ul>
                    • <tfoot id='lGpCo'></tfoot>
                    • <small id='lGpCo'></small><noframes id='lGpCo'>

                        <tbody id='lGpCo'></tbody>
                        1. <legend id='lGpCo'><style id='lGpCo'><dir id='lGpCo'><q id='lGpCo'></q></dir></style></legend>