联系官方销售客服

1835022288

028-61286886

开发框架 版主:迅睿框架研发组
iis伪静态时,前端栏目页和文章页打开均是404错误
类型:迅睿CMS 更新时间:2022-01-07 09:15:12 iis伪静态

PHP程序里面

伪静态时,

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

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

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

如何配置呢?

回帖
  • 15313173535
    #1楼    15313173535
    2022-01-07 08:32:14
    Chrome 0
    <?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
    Chrome 0
    迅睿cms对iis支持不是很友好,不建议使用iis,你可以在论坛找其他用户发的iis规则,你这个规则肯定不合适的
  • LandQ
    #3楼    LandQ
    2022-01-07 09:15:12
    Chrome 0
    <?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>