(I know this is not a programming issue per se, but it does include regular expressions, so at least it's a border ...)
Setup:
Apache 2.0 with mod_rewrite on Windows. Two domains, call them domain1.example and domain2.example. I would like to host both domains on the same server ("server1"), so I point them to the same IP address.
Now, if the user enters "domain2.example" into his browser, I want him to go to the ** subdirectory on the server, but leave the domain that he printed intact ("domain2.example / domain2 /"), of course, the redirect should leave all absolute and relative links on the pages under this domain / directory.
Is this possible with mod_rewrite (or Apache virtual hosts or another method) and how to do it?
** The "Subdirectory" in this case is not really a file folder on the disk, but a virtual folder created using the Apache "Location" directive.
Thanks.
source
share