最近发现国外的主机有些慢,把图床转移到国内,原来用的是linux-php主机,更换为国内的win主机(用的虚拟主机 星外),遇到了很多问题。之前一只用linux, 忘记了win不支持 .htaccess 。后来联系空间商协助我安装好了,还帮我修改了一下伪静态规则感谢

记录一下规则

<handlers> <remove name="PHP-7.2-7i24.com" /> <remove name="PHP-7.1-7i24.com" /> <remove name="PHP-7.0-7i24.com" /> <remove name="PHP-5.6-7i24.com" /> <remove name="PHP-5.5-7i24.com" /> <remove name="PHP-5.4-7i24.com" /> <remove name="PHP-5.3-7i24.com" /> <remove name="PHP-5.2-7i24.com" /> <add name="PHP-7.2-7i24.com" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="c:\php\7.2\php-cgi.exe" resourceType="Either" /> </handlers>

是主机配置使用PHP版本。

以下是 星外主机的。

<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <handlers> <remove name="PHP-7.2-7i24.com" /> <remove name="PHP-7.1-7i24.com" /> <remove name="PHP-7.0-7i24.com" /> <remove name="PHP-5.6-7i24.com" /> <remove name="PHP-5.5-7i24.com" /> <remove name="PHP-5.4-7i24.com" /> <remove name="PHP-5.3-7i24.com" /> <remove name="PHP-5.2-7i24.com" /> <add name="PHP-7.2-7i24.com" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="c:\php\7.2\php-cgi.exe" resourceType="Either" /> </handlers> <rewrite> <rules> <rule name="Imported Rule 1" stopProcessing="true"> <match url="^(.*)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> </conditions> <action type="Rewrite" url="index.php?s=/{R:1}" appendQueryString="true" /> </rule> </rules> </rewrite> </system.webServer> </configuration>

复制以上以上代码 保存为web.config 放在根目录下。
PS 吐槽一下这个智能安装在根目录下不能放在子目录下 遗憾

最后修改:2020 年 11 月 03 日
如果觉得我的文章对你有用,请随意赞赏