How does custom user URLs work? - url-rewriting

Today, I'm asking a question out of curiosity.
The new sites, I'm talking about.. Tumblr, Pinterest and many more are giving their users custom URLs to their sites, for example, mine on Tumblr would be maurocasas.tumblr.com instead of tumblr.com/maurocasas, as Facebook does.
My question is how do you handle this URLs? I'm curious. Some sites also let you point your own domain to your blog/site, so I could direct maurocasas.com to my Tumblr.
How do they do this? I'm curious.
Thanks!

It's pretty simple, as long as you have control over the DNS configuration of your domain. Just set up a wildcard subdomain pointing to your webserver, and then just parse the subdomain part of the hostname of the incoming request and use it as the username. You might have to configure your webserver as well to support it.

Related

Website not working on root domain with https

I am trying to deploy a NextJS website to Heroku or Vercel and add a domain name to it using https://www.names.co.uk.
Adding the domain works but for some reason I cannot access the website at https://my-website.com, however I can access it with http://my-website.com and https://www.my-website.com. I need it to work for this url 'https://my-website.com' as the website is already ranked in google with this URL. I was wondering if anyone had any idea of how this can be done. Please ask if you need more information.
Apologies if I have posted this in the wrong place.
Thanks in advance.

How to serve mulitple web applications on different subdomains?

Not sure if the title is well suited but I am having three apps (static content) at the moment:
public
app
admin
public is just content which is just for the regular web, app is content which is rendered for mobile devices and admin is basically a tool for administrative stuff. They are all contained in the same Spring Boot application and talk to the REST API at example.com/api. Technically, I could just place them into resources/static such that
resources/static/public
resources/static/admin
resources/static/app
which would allow me to access the apps as such:
example.com/public/index.html
example.com/admin/index.html
example.com/app/index.html
However, my goal is to have the following structure:
example.com // For public
admin.example.com // For admin
app.example.com // For app
example.com/api // REST API
How can this be achieved or what can I do to make this possible?
It sounds like you have three systems: public, admin and app sharing a common REST api. Probably the best approach would be to serve the static resources for each of the three systems using a content delivery network (CDN) like AWS CloudFront or Google Cloud CDN.
Another approach, though less desirable, would be to use a proxy to redirect app requests (for example https://admin.example.com to https://internal-spring-boot-server/admin). You could use Apache mod_proxy with reverse proxy (see https://httpd.apache.org/docs/2.4/mod/mod_proxy.html), or NGNX reverse proxy https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/
I think that there are two ways to achieve what you are trying to do you.
Either you will configure your subdomains in your DNS plesk/cpanel/.. to look a specific Document root (The path to the each of your apps home directory.)
for example when someone asks for example.com the request would ask for example.com/main, when someone asks for admin.example.com the request would ask for admin.example.com/admin etc. In this way, you essentially ignoring the subdomain in your Spring app and you manipulate the routes in the #Controller level using the RequestMapping values main/admin/etc..
Alternatively if you don't want to mess with the Provider's control panel, you could follow the steps of this answer. But then you'd have to implement these three custom RequestCondition classes and it may not be the most simple way to go.
Not the best documented answer but I hope I pointed you to the right direction.

Mutiple domains with SSL endpoints on one app on Heroku

The company that I work for is partnering with another organization and they want to white-label our Django app (which is hosted on Heroku). We currently have an EV certificate and SSL endpoint. The new goal is to secure both domains and avoid any certificate nags/warnings each time a user goes to the page via the new domain name.
I believe that I should be able to accomplish this with a SAN/UCC certificate. I've found a couple of very similar question posted. See here. However, while the page referenced in the previous answer still exists, the anchor for "serving-multiple-domains" is no longer on the page. And doing a search on the page doesn't find anything (maybe I'm missing it).
My question is does Heroku still support this functionality? If so, is a SAN/UCC cert the best way to accomplish this? Are there other options?

What does 302 redirects as filters mean?

I have an hosting account on Godaddy which has been redirected for last few days, to be precise, 5 days.
After mailing them quite few times, this is what they had to say
The 302 redirects are filters setup to maintain the integrity of the hosting server while we investigate and resolve an issue(s)
The post is not for boo-haa of godaddy, all I want to know is the technical aspect of the above term.
Why these filters are set, how they are set and what purpose they fulfill
Any sort of detailing on the issue will be helpful. Being a developer, it will only help when I plan to roll out hosting on my own.
The filter was set by godaddy to restrict access to your account until they can complete an investigation. The why would depend but if your website had illegal content on it whether you put it there, a user of yours or your account was hacked and someone else did would be some possible whys. By illegal I mean anything in violation of their policies or the law. The purpose is to protect their network and or you in the event that someone else is responsible for whatever they are investigating. I would call them.
I am in the process of pulling my website from Godaddy because of the same reason. They will randomly run a 302 redirect filter to protect their server. I found about 1/3 of my potential customers were being redirected to a non working version of my website. I spoke with a support staff at Godaddy and they had no reason but it is designed to protect their system. This is what you should look for. I use a company called Stat Counter and it shows your visitors paths my web address is www.actions4photographers.com What Go daddy does is take my web address and add 4-or 5 letters to the end of it and redirecting my customers to a non working version of my site.
I have had customers tell me my site was not functioning and I spent a small fortune trying to find out why. Now I know. Trying to get GoDaddy to admit that they were running the 302 redirect filters was like pulling hens teeth. I have been spending... like most of you a lot of time and money working on getting traffic to find out they are just turning away 1/3 of my traffic. How it this fair?

WebsitePanel: Programmatically add/remove domains alias

I need to implement a way to integrate my code so that I could add and remove domain aliases for a single site in WebsitePanel.
I have tried to check WebsitePanel's API, but it seems to be very limited and doesn't allow any management of sites and their domains.
Any ideas how I could do it in some other way?
I was thinking about adding domain alias directly to the site configured in the IIS (7), but I might need to add mail accounts and manage the DNS of the domain alias in the future so it doesn't seem like a good idea.
I have the same issue: I'm trying the 'wget' approach. Login can be done using Default.aspx?pid=Login&user=USER&password=PWD
Then go to the Domain area for each client, and post some data (seems to be the same for each client/domain, can be easily read from the form/input id), to get to the DNS management web.
It's way late, and it's not just "do this", but hey, it is a starting point until something better appears.

Resources