私は複数の投稿があることを知っていますが、他の回答では解決できません。.htaccess、HTTPSを強制してindex.phpを削除する
私はこれを試しました:htaccess force www and remove index.phpと.htaccess force HTTPS成功なし。
私のサイトには、ルータを実行するindex.phpがあります。実際にはリンク "/ about"はindex.php(リンク内で削除する)から管理されます。
これが私の現在の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>
それはindex.phpのために完璧に動作します(実際には、それはindex.phpをを削除し、URLを書き換えます)。
example.com
からhttps://www.example.com
(とこれは大丈夫です、私はこれが欲しいです!)から書き直すことができます。しかし、はから書き換えません。http://www.example.comからhttps://www.example.comです。
たとえば、「http://www.example.com/this/is/a/not/link/secure」というリンクはそのままです。 しかし、 "https://www.example.com/this/is/a/not/link/secure"へのリダイレクトを希望します
ありがとうございました。
EDIT:anubhava答えごとに、これは新しい全体の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]
今では二重のドメインでhttps://www.example.com/www.example.com//?id=12
でhttp://www.example.com/apiv2/member-card?id=12
を書き換える..... http://example.com/apiv2/member-card?id=12
として 同じことがhttps://www.example.com/www.example.com//?id=12
プロキシパスの使用はどうですか? http://stackoverflow.com/questions/16130303/apache-config-how-to-proxypass-http-requests-to-https#16146460 – Hackerman