WEB服务器目前常用的有。IIS,APACHE,NGINX。
小袁目前遇到的是IIS服务器下,隐含路径的问题。
那就先处理它:
一、IIS服务下的设置
一般情况下,在IIS7下,添加rewrite节点,我们这么配置:
WWWROOT下,web.Config文件:
<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>
以上常见。此外,或者别的版本的IIS,我们可以这样
ISAPI_Rewrite如果能用,就在httpd.ini上作如下配置
RewriteRule (.*)$ /index.php?s=$1
[I]
以上配置,需要开启ISAPI_Rewrite拓展。
如果ISAPI_Rewrite
3模式,可以直接使用apache配置的.htaccess
其实,个人觉得,.htaccess还是比较原味的。
关于{R:1}等等这些,就是正则式了,不明白的,看一些。