Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku still responds to mysubdomain.herokuapp.com

I have added a custom domain to my Heroku application and it works fine, but the application still responds to {mysubdomain}.herokuapp.com.

To prevent duplicate content I would like to stop having my application respond to the subdomain. Is there some setting in Heroku which does this for me, or do I need to code a 301 redirect?

like image 249
Dofs Avatar asked Jan 13 '23 20:01

Dofs


1 Answers

Another option is to use the rel="canonical" link tag. This tells search engines which URL to use for content that may appear on multiple URLs:

<link rel="canonical" href="http://www.example.com/correct_url">

Here's what google has to say: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139394

(Your use case is explicitly mentioned at the bottom.)

like image 128
drewinglis Avatar answered Jan 19 '23 12:01

drewinglis