Redirect HTTP to HTTPS with .htaccess file


I have Let's Encrypt SSL certificate for redirects to, but gives “Apache2 Ubuntu Default Page”. I tried to redirect it with following code in .htaccess file. First section was added by WordPress installer automatically.

.htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$$1 [R,L]


Problem here is that the vHost configuration for probably doesn’t point to the WordPress installation.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.