zoukankan      html  css  js  c++  java
  • CI框架CodeIgniter伪静态各种服务器设置

    Apache服务器.htaccess伪静态设置

    RewriteEngine on  
    RewriteCond $1 !^(index\.php|system\.php|images|skin|js|ls|swfupload|attachment|application|robots\.txt)  
    RewriteRule ^(.*)$ /fx/index.php/$1 [L]

    Nginx服务器伪静态设置

    location / {
            root   /var/www/html/;
            index index.html index.htm index.php;
            if ($request_filename !~* /(js|css|img|uploads|resources|robots.txt|index.php)) {
                 rewrite ^/(.*)$ /index.php?$1 last; 
            }
    }

     注:如在全局设置了root和index,此处就不需要这两项设置。

    IIS服务器web.config伪静态设置

     <system.webServer>
        <rewrite>
          <rules>
           <rule name="Imported Rule 1" stopProcessing="true">
              <match url="^/(.*)$" ignoreCase="false" />
              <conditions logicalGrouping="MatchAll">
                <add input="{R:1}" pattern="^(index.php|images|styles|scripts|uploads|resources|robots.txt)" ignoreCase="false" negate="true" />
              </conditions>
              <action type="Rewrite" url="/index.php/{R:1}" />
            </rule>
          </rules>
        </rewrite>        
      </system.webServer>

    httd.ini伪静态设置

    RewriteRule ^/(?:images|styles|scripts|uploads|resources)/(.*) $0 [L]
    RewriteRule ^/(.*)$              /$1/index.php/$2  [L]
  • 相关阅读:
    poj 1269(两条直线交点)
    poj 2398(叉积判断点在线段的哪一侧)
    poj 2318(叉积判断点在线段的哪一侧)
    HDU 5650 so easy
    POJ 1328 Radar Installation
    POJ 1017 Packets
    POJ 3190 Stall Reservations
    CodeForces 652A Gabriel and Caterpillar
    CodeForces 652B z-sort
    CodeForces 652C Foe Pairs
  • 原文地址:https://www.cnblogs.com/xusion/p/3362468.html
Copyright © 2011-2022 走看看