amreos
amreos

Reputation: 101

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

Upvotes: 7

Views: 4169

Answers (1)

Michał Młoźniak
Michał Młoźniak

Reputation: 5556

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.

Upvotes: 8

Related Questions