首页 后端开发 php教程 Apache & nginx 的地址重写 url_rewrite,省略 indexphp

Apache & nginx 的地址重写 url_rewrite,省略 indexphp

Jul 28, 2016 am 08:29 AM
index request rewrite

<code><span>Apache</span> url_rewrite:

<span><span>LoadModule</span></span> rewrite_module modules/mod_rewrite.so
<span><ifmodule mod_rewrite.c></ifmodule></span><span><span>RewriteEngine</span></span><span>on</span><span>RewriteBase</span> /

      <span><span>RewriteCond</span></span><span>%{REQUEST_FILENAME}</span> !-d
      <span><span>RewriteCond</span></span><span>%{REQUEST_FILENAME}</span> !-f
      <span><span>RewriteRule</span></span> ^(.*)$ index.php/<span>$1</span><span> [QSA,PT,L]</span><span>#RewriteRule ^(.*)$ index.php?$1 [QSA,L]</span><span></span></code>
登录后复制
<code><span>Nginx</span> url_rewrite:

location / {
    <span>if</span> (!-e <span>$request_filename</span>) {
        <span>#一级目录</span>
        rewrite ^<span>/(.*)$ /index</span>.php/<span>$1</span> last;

        <span>#二级目录</span>
        rewrite ^<span>/public/</span>(.*)<span>$ </span>/public/index.php/<span>$1</span> last;
    }
}</code>
登录后复制
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了 Apache & nginx 的地址重写 url_rewrite,省略 indexphp,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热门文章

仓库:如何复兴队友
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.能量晶体解释及其做什么(黄色晶体)
1 周前 By 尊渡假赌尊渡假赌尊渡假赌

热门文章

仓库:如何复兴队友
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.能量晶体解释及其做什么(黄色晶体)
1 周前 By 尊渡假赌尊渡假赌尊渡假赌

热门文章标签

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

index.html是什么文件? index.html是什么文件? Feb 19, 2024 pm 01:36 PM

index.html是什么文件?

php request什么意思 php request什么意思 Jul 07, 2021 pm 01:49 PM

php request什么意思

PHP中的Request对象是什么? PHP中的Request对象是什么? Feb 27, 2024 pm 09:06 PM

PHP中的Request对象是什么?

Python 3.x 中如何使用urllib.request.urlopen()函数发送GET请求 Python 3.x 中如何使用urllib.request.urlopen()函数发送GET请求 Jul 30, 2023 am 11:28 AM

Python 3.x 中如何使用urllib.request.urlopen()函数发送GET请求

PHP中Request的作用及意义 PHP中Request的作用及意义 Feb 27, 2024 pm 12:54 PM

PHP中Request的作用及意义

nginx rewrite如何实现URL跳转 nginx rewrite如何实现URL跳转 Jun 03, 2023 am 11:55 AM

nginx rewrite如何实现URL跳转

怎么将Vue3 Axios拦截器封装成request文件 怎么将Vue3 Axios拦截器封装成request文件 May 19, 2023 am 11:49 AM

怎么将Vue3 Axios拦截器封装成request文件

Nginx怎么配置location与rewrite规则 Nginx怎么配置location与rewrite规则 May 18, 2023 pm 12:25 PM

Nginx怎么配置location与rewrite规则

See all articles