0

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.

A J
  • 3,970
  • 14
  • 38
  • 53
  • What is the problem with current rules? Be specific with examples URLs that are causing problems. – anubhava Jan 02 '16 at 07:38
  • @Abhishek Agrawal thanks for the answer. As I said it works fine at a first glance. The problem arises when I log in any of my webapps the a redirection to a subfolder happens. So I what I want is when anyone gets into the url wepapp1.com/wepapp1 he goes only to webapp1.com and the subfolder is not shown. Can that be done? – Juan Carlos Mendizabal Jan 03 '16 at 07:52

0 Answers0