Url yi web config dosyası ile https ve 404 hata sayfasına yönlendirme IIS 7.5'te SLS sertifikası kullanılarak test edilmiştir.
Html linkleri https linkine çevirir ve 404 Url Rewrite yönlendirme hata sayfasınızı aktif eder.
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <defaultDocument> <files> <clear /> <add value="index.html" /> <add value="Default.htm" /> <add value="Default.asp" /> <add value="index.htm" /> <add value="iisstart.htm" /> <add value="default.aspx" /> </files> </defaultDocument> <httpErrors errorMode="Custom"> <remove statusCode="404" subStatusCode="-1" /> <error statusCode="404" path="/404.asp" responseMode="ExecuteURL" /> <remove statusCode="403" subStatusCode="4" /> </httpErrors> <rewrite> <rules> <rule name="RedirectToHTTPS" enabled="true" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
|
Sadece Http linkleri Https ye çevirir.
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <defaultDocument> <files> <clear /> <add value="index.html" /> <add value="Default.htm" /> <add value="Default.asp" /> <add value="index.htm" /> <add value="iisstart.htm" /> <add value="default.aspx" /> </files> </defaultDocument> <httpErrors> <remove statusCode="403" subStatusCode="4" /> </httpErrors> <rewrite> <rules> <rule name="RedirectToHTTPS" enabled="true" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
|
Sadece 404 Url Rewrite yönlendirme hata sayfasınızı aktif eder.
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <httpErrors errorMode="Custom"> <remove statusCode="404" subStatusCode="-1" /> <error statusCode="404" path="/404.asp" responseMode="ExecuteURL" /> </httpErrors> </system.webServer> </configuration>
|
Sayfada bulunan hata kodlarını ve 404 Url Rewrite özel yönlendirme hata sayfasınızı aktif eder.
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <httpErrors errorMode="Detailed" /> <rewrite> <rules> <rule name="OldStyle404" stopProcessing="true"> <match url=".*" /> <action type="Rewrite" url="/404.asp?404;http://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> </rule> </rules> </rewrite> </system.webServer> </configuration>
|
Alternatif
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <httpErrors errorMode="Custom"> <remove statusCode="404" subStatusCode="-1" /> <error statusCode="404" prefixLanguageFilePath="" path="/404.asp" responseMode="ExecuteURL" /> </httpErrors> <directoryBrowse enabled="true" /> </system.webServer> </configuration>
|
Edited by invertor - 10-02-2015 at 23:30