We have a Drupal 8 application hosted on Ubuntu server with Apache, PHP 5.6 and MySQL 5.6. I want to know in howmany ways can we redirect domain from http:// to https:// protocol.
I have tried following ways
When I use above approaches the site is getting down when number of requests increased. If I remove the redirect conditions the site is working fine even when more requests come to the server.
So, I want to know are there any other ways to redirect domain from http:// to https:// protocol without burden on the server.
For example:
LoadModule rewrite_module modules/mod_rewrite.so
RewriteEngine on
<VirtualHost *:80>
<IfModule mod_rewrite.c>
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [L,R]
</IfModule>
</VirtualHost>
or
LoadModule rewrite_module modules/mod_rewrite.so
RewriteEngine on
RewriteCond %{SERVER_PORT} =80
RewriteRule ^(.*) https://%{HTTP_HOST}/$1 [L,R]
or
LoadModule rewrite_module modules/mod_rewrite.so
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*) https://%{HTTP_HOST}/$1 [L,R]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.