IIS 配置伪静态规则

7 篇文章 0 订阅
1 篇文章 0 订阅

简介:IIS 环境下php 如何配置伪静态规则


前言

提示:这里可以添加本文要记录的大概内容:
例如:随着人工智能的不断发展,机器学习这门技术也越来越重要,很多人都开启了学习机器学习,本文就介绍了机器学习的基础内容。


提示:以下是本篇文章正文内容,下面案例可供参考

一、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]


或者第二种

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?id=$1
</IfModule>



二、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; 
        }

				
		if (!-e $request_filename){
			rewrite  ^(.*)$  /index.php?s=$1  last;   break;
		}	
}



三、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]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

猿男孩

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值