How to have an Apache-served Flask website with a WordPress blog at /blog? How to have an Apache-served Flask website with a WordPress blog at /blog? flask flask

How to have an Apache-served Flask website with a WordPress blog at /blog?


I got it working.

Two things I needed to do:

  1. I needed to have the line Alias /blog /var/www/html in both VirtualHost entries. At first I had only put it in the port 80 (normal-HTTP-traffic) entry, but forgot to put it in the port 443 (HTTPS traffic) entry.
    • Note that you'll only have these two VirtualHost records if you're using HTTPS. I'm using Cloudflare and forcing all requests to the website to use HTTPS, so the fact that I forgot to add the Alias record to the port 443 VirtualHost record was enough to make it appear to not be working.
  2. I needed to delete the default Apache index.html file that was in the /var/www/html directory.
    • Apache was preferring to use that over the index.php file that WordPress had added to the directory.