Windows Azure Subdomain Re-Routing with ASP.NET MVC - asp.net-mvc-2

I have the following issue, lets say I create an A record with my domain like *.mydomain.com, my main domain has a CNAME record pointing to my Windows Azure given domain name. So it goes as follows:
A record: *.mydomain.com 127.0.0.1
CNAME record: mydomain.com myservice.cloudapp.net
Now I want the ability to control custom subdomain in my application, so the user for example can create their own subdomain. This subdomain will obviously not really exist, but I will be capturing and handling the routing on my own using ASP.NET MVC. I have seen this done using .htcaccess, but I have not seen it done using ASP.NET MVC or Windows Azure...
Is this possible?

Yes it is possible - there is an excellent blog entry on this issue.

Related

Vercel and Pythonanywhere | Deploy separtly frontend and backend on domain and subdomain

I've been working on a project using Django as backend and React as a framework for the frontend. I've deployed this project in Pythonanywhere and it worked fine. Now, I would like to implement Next.js in my project but, unfortunately, Pythonanywhere does not support Node.js. So I decided to deploy my frontend in Vercel and let the backend in Pythonanywhere.
To achieve this, I plan to create a subdomain that handles the API request. In the domain DNS panel, each domain and subdomain respectively will point to different sites. It'd look like this:
www.example.com (Pointing to Vercel, where the React app is hosted)
api.example.com (Pointing to Pythonanywhere, where the backend is hosted)
I've searched about this in Google and it should work. But, here comes my question, is this the best approach or should I consider other options?
Here is a post that is related to this one. In the post, the author plans to deploy both: backend and frontend on GCP.
Thank you in advance for your time and answers!
The setup you described is pretty standard and it will work perfectly. All you need is to take care of the following points:
Make sure "www" and "#" (aka root) points to Vercel's using DNS configuration. It should be an A record to 76.76.21.21 in the root domain and a CNAME record to cname.vercel-dns.com on the "www" subdomain. Remember to redirect the domains for optimal SEO score.
The DNS record for api.example.com should point to the other provider. You need to check if they require an A or CNAME record. They may require additional DNS records (CAA?).
CORS: Notice that example.com should trigger requests to api.example.com. Your CORS configuration should account for that. CORS is a whole different discussion but I will point you in the right direction. You need to check Next.js custom headers and CORS guides.
If you face any issues on Vercel, you can contact their support channel.

custom domain mapping to subdomains

I have searched and have not been able to find anything helpful.
I have a mydomain.com that is setup to allow wildcard subdomains (*.mydomain.com).
I need to be able to have clientdomain.com point to clientdomain.mydomain.com.
I've setup a CNAME clientdomain.com > clientdomain.mydomain.com, though I get the standard CPANEL error page since clientdomain.com is not configured on that host.
I need to be able to do this on the fly - so I cannot ad a hostrecord for each domain, unless there is a way to do it programmatically.
CNAME record will not work as the parent and source domains are not hosted on the same server.
You will have to the redirection feature in cpanel to get this task done by creating proper subdomain. You can set the redirection through redirection option in cpanel.

Redirect a domain to a subdirectory of another domain

I have a domain "first.com" and I have a blog on this domain "first.com/blog" (hosting in OVH)
I would like to create a redirection: "first.com/blog" to "blog.second.com" (hosting Heroku for rails app)
I think I have to configure OVH DNS to create this "redirection", but i don't know how.
Thx for helping.

IIS Redirects - Redirecting domain without website binding

I have a bunch of domains (50+), e.g. example1.org example2.org, example3.org that I would like to redirect (301) to a single domain, examplethebest.org. Nothing is hosted on any of these domains other than examplethebest.
I've set up all the example domains in the registrar's DNS to point to the IP of my web server.
I was wondering if redirecting these is something I could achieve via rewrites in the applicationHost.config file. Or do I need to add bindings for example1 - example3.org in examplethebest's website bindings?
Just wanted to add that I understand how to do the rewrites via the web.config in examplethebest if I add bindings for the domains I want to redirect, but would rather not have loads of domain bindings - e.g. what is best practice here? Thanks!
Okay so the issue I had on this particular web server was that the default website (listening to all requests on port 80) was stopped - the other websites all had specific bindings.
At least two possible solutions for this one:
Starting the default website and adding {http_host} rewrites in there
Creating another website, make it listen to all requests on port 80 with just a web.config and putting the {http_host} rewrites in there.
We went with option 2.

Multiple heroku subdomain pointing the same custom domain

Is it possible setting multiple heroku subdomains like the following :
mydomain.heroku.com
one.heroku.com
two.heroku.com
three.heroku.com
four.heroku.com
to point to custom domain mydomain.com ?
mydomain.com
one.mydomain.com
two.mydomain.com
three.mydomain.com
four.mydomain.com
You would have to have multiple heroku applications to do this - if this is really what you want to do.
However, if you have myapp.heroku.com you can add the wildcard custom domain addon to a single application which will make your application listen on *.mydomain.com - so therefore anything.mydomain.com would come through to your application where you can then deal with it in your code.