Şimdi Ara

web.config yapılandırması hakkında

Bu Konudaki Kullanıcılar:
1 Misafir - 1 Masaüstü
5 sn
2
Cevap
0
Favori
357
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • Herkese kolay gelsin sizden bir konuda yardım talep ediyorum web.config dosyasını editlemeyle ilgili; yapılmak istenen siteye ilk girildiğinde https'li adresden açılması lazım bunun için web.config dosyası ile düzenleme yapılıyor diye biliyorum, bunun haricinde yapılabilecek uygulama var mı? bu arada aşağıdaki kodları deneme yaptım fakat çözüm olmadı.

    Teşekkürler

    1. web.config Kodu:
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <clear />
    <rule name="Redirect to https" stopProcessing="true">
    <match url="(.*)" />
    <conditions>
    <add input="{HTTPS}" pattern="off" ignoreCase="true" />
    </conditions>
    <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>

    2.web.config Kodu:
    <configuration>
    <system.webServer>
    <httpRedirect enabled="true" destination="https://www.adres.com/" />
    </system.webServer>
    </configuration>

    3. asp kodu:
    <%

    If Request.ServerVariables("SERVER_PORT")=80 Then

    Response.Redirect "https://" & Request.ServerVariables("HTTP_HOST")

    ElseIf Request.ServerVariables("SERVER_PORT")=443 Then

    Response.Redirect "https://" & Request.ServerVariables("HTTP_HOST")

    End If

    %>
    4. web.config kodu:
    <configuration>
    <system.webServer>
    <httpRedirect enabled="true" destination="https://adres.com" httpResponseStatus="Permanent" />
    </system.webServer>
    </configuration>







  • kendi cevabımı kendim yazam bari belki sizlerede yarar


    <%

    If Request.ServerVariables("SERVER_PORT")=80 Then

    Dim strSecureURL

    strSecureURL = "https://"

    strSecureURL = strSecureURL & Request.ServerVariables("SERVER_NAME")

    strSecureURL = strSecureURL & Request.ServerVariables("URL")

    Response.Redirect strSecureURL

    End If

    %>
  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.