iis伪静态时,前端栏目页和文章页打开均是404错误

迅睿框架 更新 2022-01-07 09:15:12 15313173535

PHP程序里面

伪静态时,

前端栏目页和文章页打开均是404错误,

只有首页可以正常打开访问,

是否根目录的web.config这个文件配置有问题?

如何配置呢?

方案

  • 15313173535 #1 · 2022-01-07 08:32:14
    <?xml version="1.0" encoding="UTF-8"?><configuration> <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/{R:1}" /> </rule> </rules> </rewrite> <httpErrors> <remove statusCode="404" subStatusCode="-1" /> <error statusCode="404" prefixLanguageFilePath="" path="/404.html" responseMode="ExecuteURL" /> </httpErrors> <defaultDocument> <files> <clear /> <add value="index.html" /> <add value="index.asp" /> <add value="index.php" /> <add value="default.aspx" /> <add value="default.asp" /> <add value="index.htm" /> <add value="index.aspx" /> <add value="default.php" /> <add value="default.html" /> </files> </defaultDocument> </system.webServer></configuration>这是原始的配置是好的,可以访问栏目页也文章页,但是第二天在访问,就打不开了,查看根目录配置文件web.config,变成以下代码<?xml version="1.0" encoding="UTF-8"?><configuration> <system.webServer> <rewrite> <rules> <rule name="Imported Rule 1"> <match url="^index.html$" ignoreCase="false" /> <action type="Rewrite" url="index.php" /> </rule> <rule name="Imported Rule 2"> <match url="^sitemap.html$" ignoreCase="false" /> <action type="Rewrite" url="sitemap.php" /> </rule> <rule name="Imported Rule 3"> <match url="^malllist.html$" ignoreCase="false" /> <action type="Rewrite" url="malllist.php" /> </rule> <rule name="Imported Rule 4"> <match url="^shoplist.html$" ignoreCase="false" /> <action type="Rewrite" url="shoplist.php" /> </rule> <rule name="Imported Rule 5"> <match url="^article.html$" ignoreCase="false" /> <action type="Rewrite" url="article.php" /> </rule> <rule name="Imported Rule 6"> <match url="^user/center.html$" ignoreCase="false" /> <action type="Rewrite" url="user/center.php" /> </rule> <rule name="Imported Rule 7"> <match url="^mall-(.*)-(.*)-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="mall.php?id={R:1}&amp;act={R:2}&amp;page={R:3}" appendQueryString="false" /> </rule> <rule name="Imported Rule 8"> <match url="^mall-(.*)-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="mall.php?id={R:1}&amp;act={R:2}" appendQueryString="false" /> </rule> <rule name="Imported Rule 9"> <match url="^mall-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="mall.php?id={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 10"> <match url="^view-(.*)-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="view.php?iid={R:1}&amp;page={R:2}" appendQueryString="false" /> </rule> <rule name="Imported Rule 11"> <match url="^view-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="view.php?iid={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 12"> <match url="^malllist-(.*)-(.*)-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="malllist.php?catid={R:1}&amp;mall={R:2}&amp;page={R:3}" appendQueryString="false" /> </rule> <rule name="Imported Rule 13"> <match url="^article_list-(.*)-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="article_list.php?cid={R:1}&amp;page={R:2}" appendQueryString="false" /> </rule> <rule name="Imported Rule 14"> <match url="^article_list-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="article_list.php?cid={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 15"> <match url="^read-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="read.php?id={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 16"> <match url="^list-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="list.php?cid={R:1}&amp;start_price={R:2}&amp;end_price={R:3}&amp;sort={R:4}&amp;area={R:5}&amp;guarantee={R:6}&amp;list={R:7}&amp;q={R:8}&amp;page={R:9}" appendQueryString="false" /> </rule> <rule name="Imported Rule 17"> <match url="^shop-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="shop.php?nick={R:1}&amp;start_price={R:2}&amp;end_price={R:3}&amp;sort={R:4}&amp;area={R:5}&amp;guarantee={R:6}&amp;list={R:7}&amp;q={R:8}&amp;page={R:9}" appendQueryString="false" /> </rule> <rule name="Imported Rule 18"> <match url="^shoplist-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="shoplist.php?cid={R:1}&amp;keyword={R:2}&amp;start_level={R:3}&amp;end_level={R:4}&amp;area={R:5}&amp;px={R:6}&amp;cpr={R:7}&amp;type={R:8}&amp;page={R:9}" appendQueryString="false" /> </rule> <rule name="Imported Rule 19"> <match url="^shoplist-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="shoplist.php?cid={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 20"> <match url="^shop-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="shop.php?nick={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 21"> <match url="^list-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="list.php?cid={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 22"> <match url="^list.html$" ignoreCase="false" /> <action type="Rewrite" url="list.php" /> </rule> <rule name="Imported Rule 23"> <match url="^huangou-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="huangou.php?id={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 24"> <match url="^huan-(.*)-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="huan.php?keyword={R:1}&amp;page={R:2}" appendQueryString="false" /> </rule> <rule name="Imported Rule 25"> <match url="^huan.html$" ignoreCase="false" /> <action type="Rewrite" url="huan.php" /> </rule> <rule name="Imported Rule 26"> <match url="^coupons-(.*)-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="coupons.php?cid={R:1}&amp;page={R:2}" appendQueryString="false" /> </rule> <rule name="Imported Rule 27"> <match url="^coupons.html$" ignoreCase="false" /> <action type="Rewrite" url="coupons.php" /> </rule> <rule name="Imported Rule 28"> <match url="^cuxiao-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="cuxiao.php?id={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 29"> <match url="^tg-(.*)-(.*)-(.*)-(.*)-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="tg.php?city_id={R:1}&amp;catid={R:2}&amp;mallid={R:3}&amp;keyword={R:4}&amp;page={R:5}" appendQueryString="false" /> </rule> <rule name="Imported Rule 30"> <match url="^tg-(.*)-(.*)-(.*)-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="tg.php?city_id={R:1}&amp;catid={R:2}&amp;mallid={R:3}&amp;page={R:4}" appendQueryString="false" /> </rule> <rule name="Imported Rule 31"> <match url="^tg-(.*)-(.*)-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="tg.php?city_id={R:1}&amp;catid={R:2}&amp;mallid={R:3}" appendQueryString="false" /> </rule> <rule name="Imported Rule 32"> <match url="^tg-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="tg.php?city_id={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 33"> <match url="^tg.html$" ignoreCase="false" /> <action type="Rewrite" url="tg.php" /> </rule> <rule name="Imported Rule 34"> <match url="^tgview-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="tgview.php?id={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 35"> <match url="^img/(.*).jpg$" ignoreCase="false" /> <action type="Rewrite" url="topic.php?pic={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 36"> <match url="^baobeilist.html$" ignoreCase="false" /> <action type="Rewrite" url="baobeilist.php" appendQueryString="false" /> </rule> <rule name="Imported Rule 37"> <match url="^baobeilist-(.*)-(.*)-(.*)-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="baobeilist.php?catid={R:1}&amp;sort={R:2}&amp;key={R:3}&amp;page={R:4}" appendQueryString="false" /> </rule> <rule name="Imported Rule 38"> <match url="^baobei-(.*)-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="baobei.php?id={R:1}&amp;page={R:2}" appendQueryString="false" /> </rule> <rule name="Imported Rule 39"> <match url="^baobei-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="baobei.php?id={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 40"> <match url="^userbao-(.*)-(.*)-(.*)-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="userbao.php?id={R:1}&amp;catid={R:2}&amp;xs={R:3}&amp;page={R:4}" appendQueryString="false" /> </rule> <rule name="Imported Rule 41"> <match url="^userbao-(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="userbao.php?id={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 42"> <match url="^tbimg/(.*).jpg$" ignoreCase="false" /> <action type="Rewrite" url="topic.php?pic={R:1}" appendQueryString="false" /> </rule> </rules> </rewrite> <directoryBrowse enabled="false" /> <defaultDocument> <files> <clear /> <add value="index.asp" /> <add value="index.aspx" /> <add value="index.php" /> <add value="index.html" /> <add value="Default.htm" /> <add value="Default.asp" /> <add value="index.htm" /> <add value="Default.aspx" /> <add value="index.shtml" /> </files> </defaultDocument> <httpErrors> <remove statusCode="404" subStatusCode="-1" /> <error statusCode="404" prefixLanguageFilePath="" path="/404.html" responseMode="ExecuteURL" /> </httpErrors> <security> <requestFiltering allowDoubleEscaping="true"></requestFiltering> </security> </system.webServer></configuration>
  • 迅睿框架联合创始人 #2 · 2022-01-07 08:35:49
    迅睿cms对iis支持不是很友好,不建议使用iis,你可以在论坛找其他用户发的iis规则,你这个规则肯定不合适的
  • LandQ #3 · 2022-01-07 09:15:12
    <?xml version="1.0" ?>
    <rules>
    	<rule name="XunRuicms 手机站 IIS伪静态" stopProcessing="true">
    		<match url="^mobile/(.*)$" ignoreCase="false"/>
    		<conditions>
    			<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true"/>
    			<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true"/>
    		</conditions>
    		<action type="Rewrite" url="/mobile/index.php"/>
    	</rule>
    	<rule name="XunRuicms 电脑站 IIS伪静态" stopProcessing="true">
    		<match url=".(js|ico|gif|jpe?g|bmp|png|css)$" negate="true"/>
    		<conditions>
    			<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true"/>
    			<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true"/>
    		</conditions>
    		<action type="Rewrite" url="/index.php"/>
    	</rule>
    </rules>

迅睿系统漏洞

站群分站系统
站群分站系统(2026-10-15)
子站域名新增llms.txt访问
GEO系统
GEO系统(2026-10-14)
修复下载zip空白地址问题 修复流量复刻和任务队列错误
GeoSeo收录宝
GeoSeo收录宝(2026-10-14)
新增 站长工具箱 前端首页自动调用meta 数据
滑块验证码 Gocaptcha
滑块验证码 Gocaptcha(2026-10-13)
基于开源项目 go-captcha 的行为验证码插件,滑动拼图、区域...
GeoSeo工具箱
GeoSeo工具箱(2026-10-13)
优化巡检任务
GeoSeo排名助手
GeoSeo排名助手(2026-10-11)
加入大模型自定义
SEO聚合关键字
SEO聚合关键字(2026-10-11)
优化关键字列表页最多支持1万篇文章,过多会导致服务器扛不住;
CMS内容同步复制
CMS内容同步复制(2026-10-10)
增加时间是否更新的开关