http
となし-のすべてのトラフィックをhttps
(wwwの有無にかかわらず)にリダイレクトしようとしています。 使用.htaccess
とapache VirtualHost
ファイル:apache httpをhttpsにリダイレクトします。
のVirtualHostオプション
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteCond %{HTTPS} =on
RewriteCond %{HTTP_HOST} ^www\. [NC,OR]
RewriteCond %{HTTP_HOST} ^adi-md.co.il
#RewriteRule^https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L,NE]
#RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC]
#RewriteRule (.*) https://www.%1%{REQUEST_URI} [L,R=301]
#RewriteCond %{HTTP_HOST} ^www.adi-md.co.il
の.htaccess
<VirtualHost *:80>
ServerName adi-md.co.il
ServerAlias www.adi-md.co.il
ファイル1
RewriteCond %{HTTPS} =on
RewriteCond %{HTTP_HOST} ^adi-md.co.il
オプションは2
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC]
RewriteRule (.*) https://www.%1%{REQUEST_URI} [L,R=301]
入力するだけadi-md.co.il
あなたは、サーバのデフォルトページを取得します。
すべてのトラフィックが両方ともhttps
とnone-www
の要求にリダイレクトされるように修正するにはどうすればよいですか?
注: 私はこれらの3を見てきましたが、彼らは(なし-WWWへのWWWで2アウト3取引)
apache redirect http to https and www to non www
http to https apache redirection
Redirect from http to https without www using .htaccess
アウトhttp://redirect-www.org/ –