Прошу помощи, с проблемами редиректа.
Нужно:
https://www.site.com >
https://site.com
www.site.com >
https://site.com
site.com >
https://site.com
Что не так, ткинте плиз!?
Мой Apache2 .conf:<VirtualHost *:80>
ServerName site.today
ServerAlias *.site.today
ServerAlias site.today
ServerAdmin webmaster@site.com
Redirect 301 / https://site.today/
</VirtualHost>
<IfModule mod_ssl.c>
SSLStaplingCache shmcb:/tmp/stapling_cache(128000)
<VirtualHost *:443>
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
ServerName site.today
ServerAdmin webmaster@site.com
RewriteEngine On
RewriteOptions inherit
# Redirect
RewriteCond %{HTTP_HOST} !^site\.today$ [NC]
RewriteRule ^ https://site.today%{REQUEST_URI} [L,R=301]
# Indexes + Directory Root.
DocumentRoot /home/www/site.today/
AddDefaultCharset utf-8
<Directory "/home/www/site.today">
Options None
AllowOverride All
Require all granted
Options Indexes FollowSymLinks
</Directory>
ErrorLog /home/www/site.today/error.log
# SSL
SSLEngine on
SSLCertificateKeyFile /etc/apache2/ssl/site/www.site.today.key
SSLCertificateFile /etc/apache2/ssl/site/2_www.site.today.crt
SSLCACertificateFile /etc/apache2/ssl/site/1_root_bundle.crt
SSLUseStapling on
</VirtualHost>
</IfModule>
Мой htacess:AddDefaultCharset UTF-8
Options +FollowSymlinks -MultiViews
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} !^localhost
RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Да и при создания поддомена с https:// или без "sub.site.com":
NET::ERR_CERT_COMMON_NAME_INVALID