Redirect to one of multiple sites on the server
I hope this is the right place to post this issue, serverfault seemed wrong to me...
Say I have a machine running MAMP.
This machines IP is managed in a account from dyn.com to a specific domain, say myadress.com.
In htdocs there is currently only one folder, holding an owncloud system.
Now I thought I could simply add a little homepage by adding a second folder and registred a second domain mysecondadress.com, in dyn-account.
But now, instead of setting the IP of myadress.com to xxx.xxx.xxx.xxx/owncloud
and the IP of the homepage mysecondadress.com to xxx.xxx.xxx.xxx/homepage,
I was only able to set the IP xxx.xxx.xxx.xxx.
So my next idea was, that there has to be a way to redirect, depending on the requested domain.
So that myadress.com would be redirected to xxx.xxx.xxx.xxx/owncloud
and mysecondadress.com would be redirected to xxx.xxx.xxx.xxx/homepage.
To achieve this I found some information about "WebHop", 301-redirects, using .htaccess or even virtual hosts. But the described usage everytime was a different one than my situation. Now I am totally confused what would fit my case or if thats just impossible, the way I thought of it.
As I looked into WebHop it seemed, that I would need 3 domains, say master.com, cloud.com and homepage.com, where the two latter would redirect to master.com/owncloud or master.com/homepage, but I wasn't able to get this to work.
Was that a wrong approach or did I do something else wrong?
You can still accomplish this with 2 domains, like this:
- domainA.com will open xxx.xxx.xxx.xxx/owncloud
- domainB.com will open xxx.xxx.xxx.xxx/homepage
For this, you point both domains to xxx.xxx.xxx.xxx IP and then configure your web server to support 2 different vhosts and point each configuration to use webroot of where owncloud and homepage folders are. No redirection is necessary here.
Comments
Post a Comment