Redirect to one of multiple sites on the server

Redirect to one of multiple sites on the server - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the Redirect to one of multiple sites on the server error on your web browser. Problem :


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?


Solution :

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.


We hope that this article has helped you resolve the redirects, dns, mamp error in your web browsers. Enjoy browsing the internet uninterrupted!

Comments

Popular posts from this blog

How to redirect to any domain [duplicate]

"302 found" for index page bad for SEO?

Create redirect from url like www.example.us/?p=100&option=