SORU
20 Aralık 2012, PERŞEMBE


debug yönlendirmek için https://www

Aşağıdaki debug kodu var:

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteCond !{HTTPS} off
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

</IfModule>

Benim site https://www.yönlendirilmesini istiyorum ama ben 4 ** erişim https://www beni yönlendirmez.

CEVAP
21 Aralık 2012, Cuma


İlk force HTTPS gerekir onay doğru ortam değişkeni %{HTTPS} off, ama kural yukarıda sonra başa www. Beri bir saniye kuralı uygulamak için www., kullanmıyorum ki ilk kural.

RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • AutoHotkey Tutorials

    AutoHotkey T

    29 Mayıs 2010
  • Hey Nadine

    Hey Nadine

    24 Kasım 2006
  • Mr_BrettHooge

    Mr_BrettHoog

    3 Ocak 2011