Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove herokuapp sub domain

I`m developing some apps and hosting them on heroku

there is a problem which is indexing the website

if i publish it with top level domain there will be conflict between the heroku sub domain and the main one, search engines will index both

for example if my domain is

 something.com      

and heroku sub domain is

something.herokuapp.com

what should i do to delete heroku sub domain and make it only visible on main one?

Thank you

like image 909
amreos Avatar asked Sep 10 '17 11:09

amreos


People also ask

How do I remove a domain from Heroku?

If you want to change your Heroku domain name, you can do so by going to your Heroku account settings and selecting the "Domains" tab. From there, you can add, remove, or edit your Heroku domain name.

Does Heroku give you a domain?

Heroku does not provide a domain registration service (for registering a custom domain name) or a DNS provider service (for hosting the DNS servers that point your custom domain name to your app).

Is Heroku free domain?

Heroku's free account is also quite capable, you are allowed to deploy up to 5 applications, hosted in their *. herokuapp.com domain. But, as soon as you'd like to move this app to a custom domain - you have to pay.

How do I get my CNAME from Heroku?

You can check the correct CNAME target for Custom Domains by running the Heroku CLI command: heroku domains -a your_app_name . Custom Domains created before herokudns.com was available will display your_app_name.herokuapp.com as the DNS CNAME target.


1 Answers

It is not possible right now. Heroku proposes to implement 301 redirect in such case. Because you don't have access to configuration of web server or some proxy on Heroku side, the only option is to implement it in the application code.

This information is specified here:

Your app’s Heroku Domain will always remain active, even if you’ve set up a custom domain. If you want users to use the custom domain exclusively, your app should send HTTP status 301 Moved Permanently to tell web browsers to use the custom domain. The Host HTTP request header field will show which domain the user is trying to access; send a redirect if that field is example.herokuapp.com.

like image 161
Michał Młoźniak Avatar answered Oct 10 '22 07:10

Michał Młoźniak