易企cms在 windows2008 2012 iis7+以上版本的偽靜態(tài)支持
由于這套cms過(guò)于老舊停更好多年了,官方偽靜態(tài)幫助說(shuō)明只提供了iis6 的windows2003環(huán)境下的偽靜態(tài)說(shuō)明,而對(duì)于更新的windows2012 2016 ,甚至2008不好支持。
情況一:如果您空間根目錄沒(méi)有web.config文件
這邊整理了一下支持windows2008 2012 的iis7.5以上的偽靜態(tài)腳本,將以下代碼拷貝進(jìn)txt記事本文件后,存成文檔后,然后改名成web.config,ftp上傳放置到網(wǎng)站根目錄下即可。
情況二:如果您網(wǎng)站已經(jīng)存在web.config文件
只需將兩個(gè)<rewrite>代碼部分(包含<rewrite>),插入到web.config里的;兩個(gè)<system.webserver>代碼之間。
下面有兩份代碼片段,使用任意一份即可
web.config代碼片段1
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="已導(dǎo)入的規(guī)則 1" stopProcessing="true"> <match url="^a_(.+)\.html$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <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="article.php?name={R:1}" appendQueryString="false" /> </rule> <rule name="已導(dǎo)入的規(guī)則 2" stopProcessing="true"> <match url="^p_(.+)\.html$" ignoreCase="false" /> <action type="Rewrite" url="product.php?name={R:1}" appendQueryString="false" /> </rule> <rule name="已導(dǎo)入的規(guī)則 3" stopProcessing="true"> <match url="^ca_([^/_]+)[/]?$" ignoreCase="false" /> <action type="Rewrite" url="category.php?name={R:1}" appendQueryString="false" /> </rule> <rule name="已導(dǎo)入的規(guī)則 4" stopProcessing="true"> <match url="^ca_([^/]+)_([0-9]+)[/]?$" ignoreCase="false" /> <action type="Rewrite" url="category.php?name={R:1}&p={R:2}" appendQueryString="false" /> </rule> <rule name="已導(dǎo)入的規(guī)則 5" stopProcessing="true"> <match url="^comment.html$" ignoreCase="false" /> <action type="Rewrite" url="comment.php" /> </rule> <rule name="已導(dǎo)入的規(guī)則 6" stopProcessing="true"> <match url="^sitemap.xml$" ignoreCase="false" /> <action type="Rewrite" url="sitemap.php" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
web.config代碼片段2
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Imported Rule 1"> <match url="article/(.+)\.html$" ignoreCase="false" /> <action type="Rewrite" url="article.php?name={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 2"> <match url="product/(.+)\.html$" ignoreCase="false" /> <action type="Rewrite" url="product.php?name={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 3"> <match url="category/([^/_]+)[/]?$" ignoreCase="false" /> <action type="Rewrite" url="category.php?name={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 4"> <match url="category/([^/]+)_([0-9]+)[/]?$" ignoreCase="false" /> <action type="Rewrite" url="category.php?name={R:1}&p={R:2}" appendQueryString="false" /> </rule> <rule name="Imported Rule 5"> <match url="catalog/([^/]+)[/]?$" ignoreCase="false" /> <action type="Rewrite" url="catalog.php?type={R:1}" appendQueryString="false" /> </rule> <rule name="Imported Rule 6"> <match url="comment\.html$" ignoreCase="false" /> <action type="Rewrite" url="comment.php" /> </rule> <rule name="Imported Rule 7"> <match url="sitemap\.xml$" ignoreCase="false" /> <action type="Rewrite" url="sitemap.php" /> </rule> </rules> </rewrite> </system.webServer> </configuration>