0

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:

What should I write in the root folder's .htaccess to have the subfolder site display correctly?

1 Answer 1

1
# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www.)?alias1.com$
RewriteCond %(DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %(DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^.*$ /alias1%{REQUEST_URI} [PT,L]

RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress`
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.