И это всё МОЁ
Редирект с www на без www работает только для главной. Сайт на drupal вебсервер apache2
.htaccess
...
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) %{SERVER_NAME}/$1 [R,L]
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]
apache
<VirtualHost 172.31.22.138:80>
SuexecUserGroup "#1001" "#1001"
ServerName bellame.com
ServerAlias www.bellame.com
DocumentRoot /home/bellame/public_html/web
Redirect "/" "bellame.com/"
ErrorLog /var/log/virtualmin/bellame.com_error_log
CustomLog /var/log/virtualmin/bellame.com_access_log combined
ScriptAlias /cgi-bin/ /home/bellame/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/bellame/public_html/web>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddType application/x-httpd-php7.0 .php7.0
</Directory>
<Directory /home/bellame/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
<IfModule mod_speling.c>
CheckCaseOnly On
CheckSpelling On
</IfModule>
</VirtualHost>
<VirtualHost 172.31.22.138:443>
SuexecUserGroup "#1001" "#1001"
ServerName bellame.com
ServerAlias www.bellame.com
DocumentRoot /home/bellame/public_html/web
ErrorLog /var/log/virtualmin/bellame.com_error_log
CustomLog /var/log/virtualmin/bellame.com_access_log combined
ScriptAlias /cgi-bin/ /home/bellame/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/bellame/public_html/web>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddType application/x-httpd-php7.0 .php7.0
</Directory>
<Directory /home/bellame/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile /home/bellame/ssl.cert
SSLCertificateKeyFile /home/bellame/ssl.key
SSLProtocol ALL -SSLv2 -SSLv3
SSLCACertificateFile /home/bellame/ssl.ca
<IfModule mod_speling.c>
CheckCaseOnly On
CheckSpelling On
</IfModule>
</VirtualHost>
нужно, чтобы при вводе любого url меня редиректило на https и убирало с url www.
сейчас работает все кроме обрезания www при переходе на страницы, например https://www.bellame.com/passport