Reroute Drupal 9 site from http to https using the .htaccess file
Go to the root directory of Drupal 9 site and change the write permission of the .htaccess
file to write enable.sudo chmod 777 .htaccess
Open .htaccess
with nano
commandsudo nano .htaccess