Redirect all subdomains to subfolders
- by alfonso
I'd like to add a rule so that all subdomains get redirected to a subfolder. For example:
app1.example.com -> example.com/app1
app2.example.com -> example.com/app2
something.example.com -> example.com/something
All subdomains will only be one level deep.
Questions
Which DNS providers allow me to do this?
Are these alternatives feasible?
Redirect them all to a special webapp with a static IP that redirects to the proper subfolder. How can I know from which subdomain they came from?
Programatically create each rule when I need it. Which DNS providers have API access to add rules? I think Amazon Route 53 might be the answer here.