linux系统主机可以在主机掌握面板点击【切换主站目录】进行操作,如下图所示:
windows系统可以按以下方法操作:
在主机掌握面板点击【设置首页】,将首页设置为public/index.php,并放在第一位置上。

由于还涉及到伪静态方面的问题,有些运用配置可能不适用,须要添加对应的伪静态规则。
IIS7下伪静态规则:
<?xml version="1.0" encoding="UTF-8"?><configuration> <system.webServer> <rewrite> <rules> <rule name="public" stopProcessing="true"> <match url="^(.)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^/public/" ignoreCase="false" negate="true" /> </conditions> <action type="Rewrite" url="/public/{R:1}" /> </rule> </rules> </rewrite> </system.webServer></configuration>
保存命名为web.config,上传到网站wwwroot目录。
有些程序路由规则繁芜,设置可能还是会有加载问题,可以考虑将主机升级改换为linux系统,或者联系做事商。