• 24-09-2015, 20:13:00
    #1
    Merhaba,

    http://www.mynet.com   ->    https://mynet.com
    http://mynet.com           ->    https://mynet.com
    https://www.mynet.com  ->    https://mynet.com
    http://mynet.com/a.html ->    https://mynet.com/a.html
    https://www.mynet.com/a.html -> https://mynet.com/a.html
    Yani özet olarak;

    - Sitem http ile hiç açılmasın
    - Klasör ve dosyaları http üzerinden değilde https üzerinden açsın (www olmadan açmalı).

    Bunun bir yöntemi varmı ?



    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
    Bu .htaccess söylediklerimin hepsini yapıyor sadece bir tanesi hariç.

    http://mynet.com ve http://mynet.com/a.html olarak girilince https'e yönlendirmiyor.

    Yukarıdaki koda ek olarak;

    RewriteCond %{HTTP_HOST} !^www\.(.+)$ [NC]
    yapıyorum yine olmuyor ?





    ÇÖZÜLDÜ

    Domain cloudflarede olduğundan dolayı diğer yaptığım işlemler sınırsız döngüye giriyordu.

    RewriteEngine On 
    RewriteCond %{HTTP:X-Forwarded-Proto} !https 
    RewriteRule .* https://mynet.com%{REQUEST_URI} [R=301,L]
    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

    bu .htaccess ile tüm girişleri https://mynet.com olarak sağlayabildim.
  • 01-10-2015, 17:23:38
    #2
    Options -Indexes
    RewriteEngine On
    RewriteBase /

    RewriteCond %{HTTP_HOST} !domain.com$ [NC]
    RewriteRule ^(.*)$ https://domain.com/$1 [L,R=301]

    RewriteCond %{HTTP_HOST} ^www\.(.+) [NC]
    RewriteRule ^(.*) https://%1/$1 [R=301,NE,L]


    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]


    Bu şekilde yaparsanız alias olarak eklenen domainler ile birlikte tüm istekler https://domain.com adresinize gelecektir.