• 伪静态常用配置方法


    [ Apache ]

    httpd.conf配置文件中加载了mod_rewrite.so模块
    AllowOverride None 将None改为 All
    把下面的内容保存为.htaccess文件放到应用入口文件的同级目录下
    
    <IfModule mod_rewrite.c>
     RewriteEngine on
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
    </IfModule>

    [ IIS ]

    在IIS的高版本下面可以配置web.Config,在中间添加rewrite节点:
    
    <rewrite>
     <rules>
     <rule name="OrgPage" stopProcessing="true">
     <match url="^(.*)$" />
     <conditions logicalGrouping="MatchAll">
     <add input="{HTTP_HOST}" pattern="^(.*)$" />
     <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
     <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
     </conditions>
     <action type="Rewrite" url="index.php/{R:1}" />
     </rule>
     </rules>
     </rewrite>

    [ Nginx ]

      location / {
       if (!-e $request_filename) {
       rewrite  ^(.*)$  /index.php?s=$1  last;
       break;
        }
     }
  • 相关阅读:
    归并排序
    二分查找
    分治 递归 引用 求一个数组中的最大和最小元素
    插入排序
    Poj 2503
    SELinux 基础命令
    Zend Framework中的MVC架构
    phpfpm详解
    CentOS 6 minimal 安装
    php 5.3.3 中的phpfpm配置
  • 原文地址:https://www.cnblogs.com/feimengv/p/16178954.html
Copyright © 2020-2023  润新知