宝塔设置根目录和运行目录,护卫神也是设置根目录和运行目录 public
运行目录下 web.config文件
<configuration>
<location path="." allowOverride="false" inheritInChildApplications="false">
<system.webServer>
<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?s={R:1}"/>
</rule>
</rules>
</rewrite>
</system.webServer>
</location>
</configuration>
phpstudy Apache中设置伪静态:根目录指向public
.htaccess 设置
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>