0

I need to be able to take a domain for example:

http://study.example.com will be masked to http://maindomain.com?site=study.example.com

But when customers view the page they will see http://study.example.com

If they we're to navigate to somewhere else on the site it will still show up something like

http://study.example.com/index.php?members/23566234 would basically become http://maindomain.com/index.php?members/23566234&site=study.example.com

Basically I have made it so that the first method works just fine with RewriteRules

RewriteCond %{HTTP_HOST} !^maindomain\.com
RewriteCond %{HTTP_HOST} (.+) [NC]
RewriteRule ^.*$ index.php?site=%1 [NC,L]

Works but my problem is simply the Images, is there a way to "Preserve" the rewrite to remain as maindomain.com but in the address bar its study.example.com?

Remember I will be having tons of domains to do this with not just a single one so I am trying to avoid Proxy and having to restart apache2 server everytime...

Benjamin
  • 429
  • 4
  • 17
  • You want to keep the URLs entered in the browser's address bar, which are: `http://study.example.com` or something like `http://study.example.com/index.php?members/23566234` appending the query with `site=study.example.com`, if any exists, or adding it if not. ¿Is that right? – Felipe Alameda A Jan 08 '13 at 05:06
  • Basically what I found out that if I just keep the configurations without the Rewrite Rules and just do apache's wildcard on Server Alias and have all domain names point to it, Basically this works well, when someone points their domain name to our server's ip address. This is what I wanted, I just have to find out if my Employer cares about certain things that will happen when this does. I really would like to just have it look and feel like another website but have all cookies be accessible between all domains but apparently that is not going to happen. – Benjamin Jan 08 '13 at 16:07

0 Answers0