# IIS 應用 ###### tags: `Service` `IIS` ## Url Rewrite Module (Keep Page & QueryString) 此為 IIS 的重導模組,需要透過安裝才會有 可以設定來源網址的 Pattern ,轉向目標網址,而且可以保留 QueryString 等資訊 REF: https://www.webdesigns.com.tw/ework-IIS-URLrewrite2.asp REF: https://stackoverflow.com/questions/33506754/301-redirect-for-iis-7-5-to-replace-domain-only-and-maintain-page-structure ## Url Rewrite - IP TO Domain ```xml= <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="IP Hit" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTP_HOST}" pattern="192.168.0.3" /> </conditions> <action type="Redirect" url="http://www.example.com/{R:1}" redirectType="Permanent" /> </rule> </rules> </rewrite> </system.webServer> </configuration> ``` ## 快取說明 https://forsenergy.com/zh-tw/inetsrvmmc/html/6928d32d-8d31-4714-b993-59f85711d999.htm ## 404 頁面,卻回傳 Http Status 200 的解法 https://www.sitepoint.com/community/t/iis-custom-404-page-gives-200-response-code/25313 這樣 404 頁會回傳 Status 200 ,不合需求 ```XML= <customErrors mode="On" redirectMode="ResponseRewrite"> <error statusCode="404" redirect="404.aspx"/> </customErrors> ``` 解 ```ASP.NET <% Response.Status = "404 Not Found" %> ``` ## LOG 分析 [IIS 伺服器過載 Log 分析與現場還原-黑暗執行緒](https://blog.darkthread.net/blog/iis-burnout-chart-tool/)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up