They are redirected through the adminsystem, cPanel, on my host.
Do you get to choose the directory? If you send them both to public_html/, you can use
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/forum(/.*)?$
RewriteCond %{HTTP_HOST}/site1 ^(www\.)?site1\.com(/site1)$ [NC,OR]
RewriteCond %{HTTP_HOST}/site2 ^(www\.)?site2\.com(/site1)$ [NC]
RewriteCond %{DOCUMENT_ROOT}%2%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_URI} !^/forum(/.*)?$
RewriteCond %{HTTP_HOST}/site1 ^(www\.)?site1\.com(/site1)$ [NC,OR]
RewriteCond %{HTTP_HOST}/site2 ^(www\.)?site1\.com(/site2)$ [NC]
RewriteRule .* %2%{REQUEST_URI}/ [QSA,L]
but this may cause problems as the DOCUMENT_ROOT variable will be .../public_html/ not .../public_html/site1. A symbolic link would be better.
I don't know if I can create symbolic links. Is there a way I can check that?
I think you will need to ask your host.