Last post Dec 17, 2020 10:09 AM by YihuiSun
Dec 15, 2020 11:22 AM|Erik1988|LINK
I have a website that is internal and require login, but I want to have a section that is public and being used by our customers. I can make it work by just having the URL like this "page.mysite.com/feedback/", but instead I want the site to show like this
"feedback.mysite.com". What is the easiest way to accomplish this?
I'm running Core 5 on IIS.
Dec 15, 2020 02:57 PM|mgebhard|LINK
Assuming you are using cookie authentication, just create a second IIS application and configure the URL binding. Point IIS to the same physical folder. Make sure the public pages/actions allow anonymous access.
Dec 15, 2020 03:10 PM|Erik1988|LINK
Thank you for your answer.
So, if I setup another website in IIS to point to the same location, how would it know to go to that particular location/folder?
I would assume it would just lead me to the root of the website rather than that particular folder.
Dec 15, 2020 03:37 PM|bruce (sqlwork.com)|LINK
just config a second domain name for your site and use endpoint routing with the RequireHost extension.
Dec 15, 2020 03:54 PM|mgebhard|LINK
I wrongly assumed the customers would login or provide identity (token). For example, the customer clicks an email link asking for feedback about a recent interaction. The link has information that identifies the customer or service. Your application
reads the link parameters and populates a role/claim where the user can only get to the feedback folder.
Dec 15, 2020 04:25 PM|Erik1988|LINK
Sorry I'm a bit lost.
So, If I just add the binding in IIS as "feedback.mysite.com", then I add something in startup.cs and that would be all I need to get it to work?
This is what I currently have, if someone could help me give an example on how I should write this then that would be appreciated, I'm having a hard time wrapping my head around this one.
Dec 15, 2020 04:49 PM|PatriceSc|LINK
At this point page.mysite.com and feedback.mysite.com is just the same site and so you have to use feedback.mysite.com/feedback as well which should work.
Then it seems you are looking for https://docs.microsoft.com/en-us/aspnet/core/fundamentals/url-rewriting?view=aspnetcore-5.0 so that
feedback.mysite.com/<whatever> is mapped to feedback.mysite.com/feedback/<whatever>.
Now it's perhaps a bit late but my personal preference would have been likely to just have two distinct sites depending on what you have in each part.
Edit; another common option is to have feedback.mysite.com/ showing the public part and feedback.mysite.com/<whatever> being your private part.
Dec 16, 2020 08:48 AM|Erik1988|LINK
I would like feedback.mysite.com to essentially start at /feeedback/ folder. It's okay if somone can get to this site by writing site.mysite.com/feedback, but the ones on the feedback subdomain should not be able to get to the root site if they manually
remove "folders" from the URL.
So essentially if someone goes to site.mysite.com they go to the root, and those that goes to feedback.mysite.com goes to "/feedback/", but the URL still shows "feedback.mysite.com". Is this possible? and if yes, how? I really struggle to find a way to do this.
Dec 17, 2020 10:09 AM|YihuiSun|LINK
You can understand the following concepts (assuming site.mysite.com is the
You can refer to
this link to choose URL redirect or
URL rewrite according to your actual needs.