i have gotten subdomains to work locally by editing the hosts file but i dont know how i could do this in render?
from flask import Flask
app = Flask(__name__)
# Define a route for the subdomain
@app.route('/', subdomain='sub')
def subdomain_home():
return 'Hello from the subdomain!'
# Define a route for the main domain
@app.route('/')
def main_home():
return 'Hello from the main domain!'
if __name__ == '__main__':
app.run(debug=True)
like i tried deploying this but the / domain works but the subdomain doesnt
i know that domain.onrender is already a sub domain but i think we can have sub sub domains and that the problem is with needing to edit a hosts file or something?
hi, maybe i dont understand right but, i tried subdomain in flask didnt work so i used to custom domain and connected example.com and sub.example .com but sub.example.com just goes to the default service cuz when i put sub.service.onrender .com it wont verify i think and either way it gives ssl error, does that mean i cant use flask subdomain and i would need to make a new render service and connect my sub.example . com to that service? this would technically work i just wanted to use subdomain so if you know any way pls let me know! thanks
and for some reason the main domain and sub domain i connected say certificate pending unlike my services with no sub domains, anyways if i make for sub.example.com cname to sub.service.onrender.com will it even verify? and if yes will it give the ssl error?
im sorry im just new to this so im not sure
without sub it works fine but adding sub it gives an error and you said something about custom domains i tried but maybe i just dont understand correctly i just connected my domain and when i go to sub.mydomain.com it gives the same error, so i tried verifying the subdomain itself but that just redirects to the base service page
Let’s forget about the onrender.com address, as it doesn’t support second-level subdomains, as said above.
So let’s break down any.is-a.dev
is-a.dev is your root domain.
any.is-a.dev is your subdomain.
If you want another level of subdomain, e.g. second.any.is-a.dev. You would need to add that as a custom domain to your service, and set a CNAME record for second.any to any-w1a3.onrender.com.
from what i understand, is this what you mean?? or should the cname for sub.any be sub.any-w1a3? also both say certificate issued idk why it didnt show but after reloading it showed