I have 2 WordPress sites. One is in the root catalogue and the other in the subfolder. The subfolder site has an alias domain.
The host told me to redirect the alias domains from root .htaccess. This is what I wrote in the root catalogue's htaccess file for one of the subdomains and it is not working.
https://rootcatalogue.com/subfolder as https://aliasdomain.com
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{HTTP_HOST} ^(www.)?aliasdomain.com$
RewriteCond %{REQUEST_URI} !^/subfolder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /subfolder1/$1
RewriteCond %{HTTP_HOST} ^(www.)?aliasdomain.com$
RewriteRule ^(/)?$ subfolder/index.php [L]
</IfModule>
Now the front page of the subfolder seems ok, only some css is missing. On other pages the css, images and links are of the root folder site.
In General settings:
- WordPress Address (URL) https://rootcatalogue.com/subfolder
- Site Address (URL) https://aliasdomain.com
What should I write in the root folder's .htaccess to have the subfolder site display correctly?