Koozali.org: home of the SME Server

Can you run two domains on same ibay?

Offline wdepot

  • ***
  • 89
  • +0/-0
    • http://westerndepot.com
Can you run two domains on same ibay?
« on: July 12, 2022, 11:54:06 PM »
Is it possible to run two different domains from the same ibay in SME 10? For example if you wanted xyz.com and xyz.org to run the same web site. I've found that I can set multiple domains to point to the same ibay in SME 10 but whether you can actually access the files in the ibay from both domains seems to depend on the browser used. With Firefox and Opera it seems to work just fine but with Edge and Chrome I get a too many redirects error. Is there some tweak that needs to be made in httpd.conf to make this sort of thing work properly in any browser or do I need to give up on the idea and have two identical copies of the web site in two separate ibays?

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Can you run two domains on same ibay?
« Reply #1 on: July 13, 2022, 01:20:30 AM »
as many as you want. just make dns point to your server and add the domain from server manager pointing to your ibay


however from what i see with redirect error, do you want visitor to keep the domain they asked or do you want then to be redirected to one of them?

Offline wdepot

  • ***
  • 89
  • +0/-0
    • http://westerndepot.com
Re: Can you run two domains on same ibay?
« Reply #2 on: July 13, 2022, 02:05:30 AM »
as many as you want. just make dns point to your server and add the domain from server manager pointing to your ibay

however from what i see with redirect error, do you want visitor to keep the domain they asked or do you want then to be redirected to one of them?
Well the idea was that links to other pages on the site would all be to one of the domains but just accessing a specific page using the other domain name would just show the contents of the page without directly changing the domain name used by the browser. Basically I would want it to work in the same way that entering www.xyz.org/page.htm pulls up the same file as xyz.org/page.htm without the browser dropping the www until a link on the page that goes to say http://xyz.org/nextpage.htm is clicked.

I've looked at the httpd.conf file that was generated by SMEServer and there is no obvious reason there for the multiple redirects in Edge and Chrome but it did sort of make me wonder if the secondary domain could be added as a ServerAlias of the primary domain rather than as its own VirtualHost it might solve the problem. If you could have for example:

Code: [Select]
    ServerName xyz.org
    ServerAlias www.xyz.org xyz.com www.xyz.com
I just have no idea how this could be set up in SMEServer so that would be maintained when a reconfigure is performed.

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Can you run two domains on same ibay?
« Reply #3 on: July 13, 2022, 06:58:51 AM »
http to https could be a reason
 then you add www.xyz.a to xyz.a
then you add xyz.a to xyz.b

could be more than accepted by some browsers.

domain set a redirection at your dns provider could ba another.  i should rather be configured as cname or A.

for virtualhost, yes it could. but sme server is not built this way.  so indeed
it creates two virtualhosts.

i am not sure it would change something for the redirections.


last time i had something similar i rather used a rewrite rule to handle this before displaying the website.
in term of reference for search engine it would be better

 

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Can you run two domains on same ibay?
« Reply #4 on: July 13, 2022, 07:00:57 AM »
also SME 10 is designed to force redirection to https.  if your links are designed to point to http you add one more level of redirection on every click.

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: Can you run two domains on same ibay?
« Reply #5 on: July 13, 2022, 01:26:44 PM »
This may be completely off base, but...

I've seen similar redirect confusion caused by DNS over HTTPS.

Browsers on your LAN with DNS over HTTPS enabled will access your SME using the WAN IP.

Browsers on your LAN with DNS over HTTPS disabled will access your SME using the LAN IP.

(Browsers on the WAN should see the WAN IP either way, unless you're using a VPN or Proxy connected to your LAN...)

My default browser is Firefox. Firefox DoH can be configured manually, but I use a canary domain to disable DoH so I don't need to reconfigure every firefox profile on every device on my network.

I have not yet found any definitive way verify a browser's DoH status other than intentionally creating a web page that works locally-but-not-remotely and another that works remotely-but-not-locally and then attempting to load the web page in a private browser window...

Offline wdepot

  • ***
  • 89
  • +0/-0
    • http://westerndepot.com
Re: Can you run two domains on same ibay?
« Reply #6 on: July 13, 2022, 07:36:35 PM »
I've just discovered the source of the problem. The ibay was set to force secure connections. When secure connections are forced then trying to connect using the secondary domain name causes the too many redirects error when using Edge or Chrome. If you don't have the ibay set to force secure connections then you can connect to the site contained on that ibay with no problem at all with any browser using either domain whether you use http or https.

It will be a simple matter for me to set the site so all links to other pages use https so it won't particularly matter if the server forces a secure connection or not. If the user originally connects using http then the moment they move to another page on the site they would get switched to https.

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Can you run two domains on same ibay?
« Reply #7 on: July 14, 2022, 01:07:25 AM »
one more point toward rewriterule or redirect before reaching the ibay.