ThinkPhp Laravel类网站配置二级目录访问方法
Nginx服务器
location /api/ {
index index.php;
if (!-e $request_filename){
rewrite ^/api/(.*)$ /api/index.php?s=$1 last; break;
}
}
Win iis服务器
如果配制有什么问题,联系我。<rewrite>
<rules>
<rule name="api" stopProcessing="true">
<match url="^api/(.*)$" />
<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="/api/index.php/{R:1}" />
</rule>
</rules>
</rewrite>
码字很辛苦,转载请注明来自NAERENET的《ThinkPhp Laravel类网站配置二级目录访问方法》