WordPress Permalinks create RESTful link style like: blog/category/sub-cat/post-title. These are not actual directories in your Apache DirectoryRoot hence you cannot just set a subdomain to point to a WP Permalinks via DocumentRoot /var/www/category/blog/bla/bla/bla.
In my case I was trying to set security.addaxsoft.com to point to addaxsoft.com/blog/security. Many methods failed and the only trick that worked resides in RewriteRules and WordPress URL Parameters.
- Set new DNS A record. eg: security.addaxsoft.com some-IP-address
- Set new VirtualHost in your apache config file as follow:
RewriteRule . /var/www/index.php?category_name=[YOUR CATEGORY NAME]
- Restart Apache and you’re good...