I need a domain to work completely within a subfolder without giving away that its within that subfolder (have the client only see the domain.com)
I was able to get it to work on a pretty basic level, but haven't figured anything out that is flexible enough to work with multiple subfolders within the redirected subfolder.
This is what I've had the MOST success with:
- Code: Select all
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?maindomain.com$
RewriteCond %{REQUEST_URI} !^/subfolder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /subfolder/$1
RewriteCond %{HTTP_HOST} ^(www.)?maindomain.com$
RewriteRule ^(/)?$ subfolder/index.php [L]
That fixes the main page to show up nicely, but very little else. I have a folder within my site that I use to install all kinds of open source software like coppermine, pmwiki, modx, dada mail etc. If I navigate to those, the subfolder always shows or it won't work period.
edit: oh and I'm using shared hosting. So the subfolder would be within /home1/username/public_html/subfolder