Ok, I’ve found a few threads pertaining to very similar issues, but haven’t had any luck using the answers provided for my own site. Basically I have 2 sites, mapped like this:
/public_html/ - points to main domain (www.site1.com)
/public_html/site2.com - points to secondary domain (www.site2.com)
/public_html/portal - points to my target subdirectory
I’m trying to get all requests to http://www.site2.com/portal to load http://www.site1.com/portal transparently, that is I still want http://www.site2.com/portal to show in the address bar.
RewriteCond %{HTTP_HOST} ^(www\.)?site2\.com [NC]
RewriteCond %{REQUEST_URI} ^/portal/(.*)$
RewriteRule ^/(.*) /portal/$1 [L]
doesn’t work at all
RewriteCond %{HTTP_HOST} ^(www\.)?site2\.com$ [NC]
RewriteCond %{REQUEST_URI} ^/portal/(.*)$
RewriteRule ^(.*)$ http://site1.com/portal/$1 [L]
takes me to http://site1.com/portal/site2.com/portal.
I’ve been beating my head against a wall over this for a couple days, any help would be appreciated!
Your current setup is not going to support what you are trying to get unless you enable mod_proxy in your httpd.conf. So here are 2 options available with you:
Option 1: Enable mod_proxy and retain current directory structure
Put this code in your
.htaccessunderpublic_html/site2.comdirectory:Option 2: Retain current directory structure and create a symbolic link like this:
Then put this code in your
.htaccessunderpublic_html/site2.comdirectory:IMHO option # 2 is going to be much easier for you since it just requires creating one symbolic link (I believe you are using some flavor of
*nix.