2016-07-09 13 views
2

Ich habe eine Website zB: example.com mit Lets Encrypt SSL installiert. Ich möchte erzwingen alle URL von https auf http umleiten, aber gleichzeitig will ich die Homepage Force-Umleitung von http zu https. Ist so etwas möglich? Danke..htaccess https nur für Homepage und http für andere

Mein aktueller .htaccess

<IfModule mod_rewrite.c> 
    RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] 
    RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] 
    RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) 
    RewriteRule .* index.php [F,L] 
</IfModule> 
Options +FollowSymlinks 

RewriteEngine on 
RewriteBase/

RewriteCond %{SERVER_PORT} ^443$ [OR] 

RewriteCond %{HTTPS} =on 
RewriteRule ^(.*)$ http://clix2reach.com/$1 [R=301,L] 

Antwort

1

Sie können versuchen, dies mit:

RewriteEngine On 
RewriteBase/

# Turn HTTPs on for homepage 
RewriteCond %{HTTPS} off 
RewriteCond %{REQUEST_URI} ^/index.php 
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] 

# Turn HTTP on for everything but homepage 
RewriteCond %{HTTPS} on 
RewriteCond %{REQUEST_URI} !^/index.php 
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L] 

ändern index.php auf Name/Erweiterungsdatei abhängig.

Verwandte Themen