<VirtualHost *:80>
  ServerName example.com
  DocumentRoot /var/www/wordpress
  DirectoryIndex index.php
  <Directory /var/www/wordpress/>
    AllowOverride All
    Order Deny,Allow
    Allow from all
  </Directory>
  RewriteEngine on
  RewriteCond %{SERVER_NAME} =www.example.com [OR]
  RewriteCond %{SERVER_NAME} =example.com
  RewriteRule ^ https://example.com%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>