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

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

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

        <tfoot id='Rh8Ag'></tfoot>
      1. url重写index.php

        url rewriting index.php(url重写index.php)
      2. <tfoot id='MSOLu'></tfoot>
            <bdo id='MSOLu'></bdo><ul id='MSOLu'></ul>
              <tbody id='MSOLu'></tbody>

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

              • <small id='MSOLu'></small><noframes id='MSOLu'>

                  <legend id='MSOLu'><style id='MSOLu'><dir id='MSOLu'><q id='MSOLu'></q></dir></style></legend>
                • 本文介绍了url重写index.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有类似的网址

                  http://mysite.com/index.php?p=resources
                  http://mysite.com/index.php?p=resources&s=view&id=938
                  

                  但我想要像这样的网址

                  http://mysite.com/resources
                  http://mysite.com/resources/view/938
                  

                  与其制定数百个重写规则,我想知道是否有可能只有一个?我认为这是可能的,方法是获取 uri 并将其拆分为多个部分",然后只需为 index.php 添加重写规则

                  instead of making hundreds of rewrite rules i wonder if it would be possible to just have one? Ive head this is possible by "getting the uri and splitting it into parts" and then just add a rewrite rule for index.php

                  但是怎么样?有人可以举个例子或链接一个教程

                  but how? could someone give an example or link a tutorial

                  推荐答案

                  我碰巧在 .htaccess 中使用了这个:

                  I happen to use this in .htaccess:

                  RewriteCond %{REQUEST_FILENAME} !-f
                  RewriteCond %{REQUEST_FILENAME} !-d
                  RewriteCond %{REQUEST_FILENAME} !-l 
                  
                  RewriteRule .* index.php [L]
                  

                  无论请求什么,这本质上都会调用 index.php.然后在您的 PHP 代码中,您可以查看 $_SERVER['REQUEST_URI'] 以获取 URL 并相应地对其进行解析.

                  This essentially calls index.php no matter what is requested. Then inside your PHP code you can look at $_SERVER['REQUEST_URI'] to get the URL and parse it accordingly.

                  RewriteCond 行用于排除对文件的直接调用.就我而言,出于性能原因,我不希望诸如对 js/css/image 文件的请求之类的内容通过 index.php.

                  The RewriteCond lines are there to exclude direct calls to files. In my case I don't want stuff like requests for js/css/image files to go through index.php for performance reasons.

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

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

                  相关文档推荐

                  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='ZXST7'><tr id='ZXST7'><dt id='ZXST7'><q id='ZXST7'><span id='ZXST7'><b id='ZXST7'><form id='ZXST7'><ins id='ZXST7'></ins><ul id='ZXST7'></ul><sub id='ZXST7'></sub></form><legend id='ZXST7'></legend><bdo id='ZXST7'><pre id='ZXST7'><center id='ZXST7'></center></pre></bdo></b><th id='ZXST7'></th></span></q></dt></tr></i><div id='ZXST7'><tfoot id='ZXST7'></tfoot><dl id='ZXST7'><fieldset id='ZXST7'></fieldset></dl></div>
                        <tbody id='ZXST7'></tbody>
                    • <legend id='ZXST7'><style id='ZXST7'><dir id='ZXST7'><q id='ZXST7'></q></dir></style></legend>

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

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

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