Ich weiß, dass es mehrere Beiträge gibt, aber ich kann nicht mit anderen Antworten lösen..htaccess, erzwinge HTTPS und entferne index.php
Ich habe dies versucht: htaccess force www and remove index.php und .htaccess force HTTPS ohne Erfolg.
Meine Website hat eine index.php, die Router ausführen. So wird ein Link "/ about" in Wirklichkeit von index.php verwaltet (um den Link zu entfernen).
Dies ist meine aktuelle .htaccess:
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
RewriteCond %{HTTP_HOST} !=localhost [NC]
RewriteCond %{HTTP_HOST} !=127.0.0.1
RewriteRule^https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ %{HTTP_HOST}/$1/ [R=301,L]
</IfModule>
Es funktioniert perfekt für die index.php (in der Tat es die index.php und schreiben Sie die URL entfernt).
Es kann example.com
-https://www.example.com
umschreiben (und das ist in Ordnung, ich will diesen!). Aber es nicht von http://www.example.com zu https://www.example.com umschreiben.
Zum Beispiel bleibt ein Link wie "http://www.example.com/this/is/a/not/link/secure" so wie es ist. Aber ich möchte eine Weiterleitung zu "https://www.example.com/this/is/a/not/link/secure"
Vielen Dank.
EDIT: Per anubhava Antwort, das ist die neue gesamte .htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php [L,QSA]
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?!localhost$|127\.0\.0\.1$)(?:www\.)?(.+)$ [NC]
RewriteRule^https://www.%1%{REQUEST_URI} [R=301,L,NE]
RewriteCond %{THE_REQUEST} /index.php [NC]
RewriteRule ^(.*)index\.php$ /$1/ [R=301,L,NC,NE]
es nun ein http://www.example.com/apiv2/member-card?id=12
in https://www.example.com/www.example.com//?id=12
mit einer Doppel-Domain neu zu schreiben ..... Gleiche wie http://example.com/apiv2/member-card?id=12
wurde neu geschrieben in https://www.example.com/www.example.com//?id=12
Wie wäre es mit Proxy-Pass? http://stackoverflow.com/questions/16130303/apache-config-how-to-proxypass-http-requests-to-https#16146460 – Hackerman