Skip to content

Latest commit

 

History

History
38 lines (19 loc) · 1.44 KB

README.md

File metadata and controls

38 lines (19 loc) · 1.44 KB

Hide Heroku

Hides default Heroku (*.herokuapp.com) URLs from search engines in order to avoid duplicate content issues.

Info

All Heroku apps are accessible via the *herokuapp.com, even after a custom domain is assigned. This introduces the potential for duplicate content issues if search engines index the same content under both custom and default domains.

HideHeroku blocks robots from all content served under the *.herokuapp.com domain, including assets, by issuing 'noindex, nofollow' X-Robots-Tag HTTP response headers on those requests.

More on X-Robots-Tags:

Installation

hide_heroku is Rack middleware that can be used with Rails or any other Rack application.

Add this line to your application's Gemfile:

gem 'hide_heroku'

And then execute:

$ bundle

Or install it yourself as:

$ gem install hide_heroku

For non-rails applications, add this line to the config.ru file:

use Rack::HideHeroku