WORDPRESS 在WIN2003主機下偽靜態正確代碼
阿新 • • 發佈:2019-02-24
onf .com pan 環境 factor 建站 1.0 問題 ESS
今天幫客戶做了網站,https://www.tui21.shop/ 在WIN2003 主機上用 西部數據建站助手搭建的 全能環境,用wordpress搭建了一個網站,
在設置偽靜態的時候,發現不能自動生成web.config文件, 而之前在GODADDY的全能主機上安裝的wordpress就可以自動生成web.config文件。
而把godaddy上面那個web.config文件復制到 tui21.shop上面,發現用不了。這裏把代碼貼出來,供大家參考。
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="WordPress: https://blog.zobdii.com" patternSyntax="Wildcard"> <match url="*"/> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/> </conditions> <action type="Rewrite" url="index.php"/> </rule></rules> </rewrite> </system.webServer> </configuration>
下面貼出可以正確使用的文件:
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="wordpress" patternSyntax="Wildcard"> <match url="*"/> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/> </conditions> <action type="Rewrite" url="index.php"/> </rule></rules> </rewrite> </system.webServer> </configuration>
貌似這個name的問題,兩個文件還是差不多的。下面這個是通用的,只要是全能主機,能安裝上WORDPRESS,都是可以用的。
參考網址:http://www.aid12580.com/
WORDPRESS 在WIN2003主機下偽靜態正確代碼