File: //etc/apache2/sites-enabled/unitask.conf
<VirtualHost *:80>
ServerName unitask.riarauniversity.ac.ke
DocumentRoot /var/www/unitask
<Directory /var/www/unitask>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/unitask_error.log
CustomLog ${APACHE_LOG_DIR}/unitask_access.log combined
# Redirect HTTP to HTTPS
RewriteEngine on
RewriteCond %{SERVER_NAME} =unitask.riarauniversity.ac.ke
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>