I have scoured several pages, answers and articles in an attempt to correctly configure Apache Alias and Wordpress Permalinks without success.
/var/www/
| - example.com (Custom Web App)
| - blog.example.com (Wordpress)
Using the structure above, I am able to access Wordpress without any issues, including permalinks such as https://blog.example.com/sample-post/
.
I have added an alias in Apache as shown below:
<VirtualHost *:443>
ServerName example.com
DocumentRoot /var/www/example.com/public
Alias /blog /var/www/blog.example.com
<Directory /var/www/example.com/public>
AllowOverride all
Options -Multiviews
Require all granted
</Directory>
</VirtualHost>
After making those changes, restarting apache and updating the wordpress address
and site address
in the WordPress settings area, I can access the site at the desired URL https://example.com/blog
but permalinks return 404 errors.
I find that I must switch to plain URLs to get posts to load. I have made no changes to the .htaccess
file, however this is the content:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
The objective is to access WP posts at https://example.com/blog/sample-post/
Any help is appreciated.