I have a bit of an issue. I have a main domain setup with WordPress and that works great, but then I have a subdomain, which is at "training.domain.com" and in folder called "training", I want to point all requests that are going to "training.domain.com" to the subfolder, but I'm failing at do so. In the main domain folder, I have this .htaccess
AddHandler application/x-httpd-phpbetas .php
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# Custom subdomain .htaccess SSL + WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^training.domain.com$
RewriteCond %{REQUEST_URI} !^/training/
RewriteRule ^(.*)$ /training/$1
RewriteCond %{HTTP_HOST} ^training.domain.com$
RewriteRule ^(/)?$ training/index.php [L]
</IfModule>
Now this way, I am able to access the subdomain, but the problem comes, when on the subdomain are CSS and JS files in WordPress installation, that just throw 404. It is crucial to note, that this happens only in HTTPS mode.
The subdomain folder has this .htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]]
# END WordPress
I'm not sure where the error is. You can really access only the homepage any subpages say "training.domain.com/page/page2" just throw 404. Same with files that are nested in folders.
Does anybody of you guys know how to solve this?
Thanks, James