业务经理

微信扫描以上二维码

028-61286886

技术咨询

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-09-14)
子站独立部署时修复同步附件失败问题
在线客服
在线客服(2026-09-13)
修复删除会话报错问题 删除会话时联动删除聊天图片
在线考试竞赛系统
在线考试竞赛系统(2026-09-12)
增加投票功能 考试功能拓展 注意:更新后需要执行系统更新,更新数...
网上信箱
网上信箱(2026-09-12)
修复新版本兼容问题
GeoSeo收录宝
GeoSeo收录宝(2026-09-12)
1 优化Update.php文件,解决版本在线升级不完整问题 2 ...
GeoSeo工具箱
GeoSeo工具箱(2026-09-11)
修正历史记录推送
微信系统
微信系统(2026-09-11)
增加数据统计总览界面 账号管理增加服务和公众号的区别 菜单管理支持更...
答题系统
答题系统(2026-09-11)
一站式在线答题系统,支持真题考试、题库练习和错题本,适合培训、考证、...
阿里云滑动验证码
阿里云滑动验证码(2026-09-10)
采用阿里云验证码替换迅睿系统自带的图片验证码和滑动验证码。后台设置方...
下载Plus
下载Plus(2026-09-09)
为网站附件下载加上“计数、限次、统计、防护”四重能力:按用户组控制下...