I've been checking many posts around SO and the web but my particular situation is not being covered, I guess it is quite easy, but I'm stuck, if you could help would be awesome, here it is my problem:
I have a multisite set up through Turnkey Lamp to a AWS EC2 server. So I have 3 webapps pointing to the same /www folder. In my hosting each webapp has it's on subfolder and with the help of .htaccess I'm masking the domains to the subfolders that correspond.
Visually:
webapp1.com -> www/webapp1
webapp2.com -> www/webapp2
webapp3.com -> www/webapp3
So far so good, when you go to each domain it fetches the content of the subfolder and doesn't show it. At first glance was fine but this apps require log in and once I do it the user is redirected to webapp1.com/webapp1 and the same for all the other webapps.
In the this example I'm trying to hide the webapp1 subfolder at all times but I can't get it to work properly.
Here it is my code:
RewriteEngine On
RewriteCond %{HTTP_HOST} webapp1.com$ [NC]
RewriteCond %{REQUEST_URI} !^/webapp1/.*$
RewriteRule ^(.*)$ /webapp1/$1 [L]
RewriteCond %{HTTP_HOST} webapp2.com$ [NC]
RewriteCond %{REQUEST_URI} !^/webapp2/.*$
RewriteRule ^(.*)$ /webapp2/$1 [L]
RewriteCond %{HTTP_HOST} webapp3.com$ [NC]
RewriteCond %{REQUEST_URI} !^/webapp3/.*$
RewriteRule ^(.*)$ /webapp3/$1 [L]
Please let me know if this is clear enough.