zoukankan      html  css  js  c++  java
  • apache-Rewrite重写规则配置

    0x01.

    通过重写规则,xx/index.php/xxx => xx/xxx

    在网站根目录下,添加个.htaccess文件,apache读取时,会自动匹配.htaccess里的规则

    ......

    0x02

    .htaccess 添加正则代码

    <IfModule mod_rewrite.c>

      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
     </IfModule>

    ------------------------

    httpd.conf 配置

    开启重写模块 #loadmodule rewrite_module libexec/apache2/mod_rewrite.so 去掉#注释

    修改<directory /xx/xxx>

    AllowOverride none =>AllowOverride All

    </directory>

    重启apache

    ......待定

  • 相关阅读:
    Vue3.0
    Vue
    Vue
    Vue3.0
    Vue
    Vue
    Vue
    Vue
    Vue3.0
    万字长文|十大基本排序,一次搞定!
  • 原文地址:https://www.cnblogs.com/developd/p/4465262.html
Copyright © 2011-2022 走看看