Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

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.

share|improve this answer
    
Okay, thank you - so I will have a deeper look into virtual hosts. Does "Server" in that case mean my MAMP or the actual machine it's running on? –  Jochen Reinschlüssel Mar 27 at 6:45
    
MAMP. Have a look at this page: sawmac.com/mamp/virtual –  edvinas.me Mar 27 at 8:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.