Install the app
How to install the app on iOS

Follow along with the video below to see how to install our site as a web app on your home screen.

Note: This feature may not be available in some browsers.

www redirects to default website - how to fix?

As an Amazon Associate, we may earn commissions from qualifying purchases. Learn more...

264
36
NAS
DS918+
Operating system
  1. macOS
Mobile operating system
  1. iOS
I've worked out how to add a new domain and website to my Synology. I've set up basic DNS (elsewhere) and a web browser request for mynewdomain.tld gets you to my NAS. I've got a certificate so all is good.

The DNS Zone has a CNAME for www.mynewdonain.tld. pointing to mynewdomain.tld. So that means a request for www.mynewdoman.tld should take
you to the same website. But instead it takes you to the default Synology "Web Station has been enabled. To finish setting up your website, please see the "Web Service" section of DSM Help.". The URL is www.mynewdomain.tld and its not secure (but maybe I didn't add www. to the certificate). But why am I served the default Synology webpage, not my mynewdomain page?
 
The main question here is how is this being handled on the NAS/DSM side? Web Station, Reverse Proxy or something else? Guessing you are targeting https in this case? How is this handled on the router on your end as well?
 
Upvote 0
Provided you haven’t used Web Station to setup www.mynewdomain.tld as a virtual server, and there is no reverse proxy directing it elsewhere: a request that resolves to your WAN IP and port forwards to the NAS will be served by whatever default service is listening on the port. And breathe!

Are you sure you have started to create a web service?
 
Upvote 0
Are you sure you have started to create a web service?
I'm not sure of anything...

(Mostly I'm not clear what Web Station's Portal and Service do. I'm researching but this penny has yet to drop.)

I have a Web Portal for mynewdomain.tld. I also have a Web Service for the domain and the document root points to web/mynewdomain-tld where there's a basic index.html file.

I've created a certificate and that seems to work fine. https://mynewdomain.tld is secure!

will be served by whatever default service is listening on the port.

Isn't it all port 443? I ask for https://mynewdomain.tld and get the page I've added to web/mynewdomain-uk. When I ask for https://www.mynewdomain.tld I get the default Synology web page.

So somewhere something is redirecting any www requests to the default Synology page and not to mynewdomain.uk?
 
Upvote 0
I'm not sure of anything...
Welcome to the club :) I’ve been here for quite a while.

I recall that in a not so recent update to web Station they changed how it worked. But basically it goes like this:
  1. Create Scripting Language Settings you want for PHP and Python.
  2. Create Web Service that defines the backend services to use:
    1. Static website just has the web engine (Apache, Nginix).
    2. Native scripting language uses one of your Scripting Language services and assigned the web engine (this is what I usually use).
    3. Containerised script language is for use with Container Manager (not used it yet). Seems to be similar to NSL service.
  3. Create a Web Portal Service that uses one of your web Services. This then defines how to access this ‘portal’ service, i.e. unique hostname / port / alias. You can apply access policies (from Control Panel’s Login Portal/Advanced), which can allow/block access from defined sources.
In Control Panel you can assign SSL certificates to these Web Portals.

All this is can piggy-back lots of web services, applications portals, and reverse proxies on a single TCP port. So you can have a lot of HTTPS services on port 443, provided they can be uniquely identified by the built-in proxy service using the requested server/hostname.
 
Upvote 0
Welcome to the club :) I’ve been here for quite a while.

So funny thing is when I edit the Web Portal so Hostname is www.mynewdomain.tld that works fine. Then when I request mynewdomain.tld I get to the default Synology page. So a reverse of what was happening!

Now Ive created a new Web Portal so I have one for mynewdomain.tld and another www.mynewdomain.tld. Both now appear to work as expected.

I should be happy but I’m not as I don’t understand.

Of course I’m just dipping my toes in to see how things go. If Inget this running correctly I’d expect requests for www to redirect to the non-www page, rather that have both. But that’s too advanced to think about now…
 
Upvote 0
The default site for Web Station is whatever is in /volumeN/www. When there is no Web Portal, App Portal, or reverse proxy assigned for the requested server/hostname on TCP 80/443 then it will serve the default site.

You see the default portal Hostname is *, meaning anything that gets here [i.e. to the NAS] that isn’t otherwise specified to do something else.

1724857110383.webp


If you created a Web Portal or reverse proxy for mynewdomain.tld then the Default Portal would ignore it. In effect the default is a catch-all site.

I’m wondering if the confusion is how unwritten rules of the Internet have come about so that www.domain and domain are now often synonymous and return the same site. In the early years of the Internet this wasn’t at all common and using just ‘domain’ wouldn’t work. As such it’s an ease-of-use change to help users that web and DNS admins do… obviously SSL certificates have to match both.
 
Upvote 0

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Popular tags from this forum

Thread Tags

Tags Tags
website

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending content in this forum

Back
Top