Print Page | Close Window

https ve 404 hata sayfasına yönlendirme web.config

Printed From: Bilginin Adresi
Category: Webmaster
Forum Name: Webmaster Genel
Forum Description: Webmasterlar için genel konularla ilgili bir tartışma forumu
URL: http://www.bilgineferi.com/forum/forum_posts.asp?TID=10436
Printed Date: 23-09-2020 at 02:08


Topic: https ve 404 hata sayfasına yönlendirme web.config
Posted By: invertor
Subject: https ve 404 hata sayfasına yönlendirme web.config
Date Posted: 03-02-2015 at 00:45
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>




-------------
http://www.bilgineferi.com/forum/forum_posts.asp?TID=8328" rel="nofollow - Hash Kontrolü yapma ( MD5, SHA-1, CRC32,... vb)



Replies:
Posted By: invertor
Date Posted: 03-02-2015 at 17:48
  Domain'e özel  ip adresi ile giriş yapıldığında  Domaine yönlendirme




<?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>




-------------
http://www.bilgineferi.com/forum/forum_posts.asp?TID=8328" rel="nofollow - Hash Kontrolü yapma ( MD5, SHA-1, CRC32,... vb)



Print Page | Close Window