Direct search engines not to index *.herokuapp.com URLs.
Project description
django-hide-herokuapp
=====================
Django app for Heroku users designed to hide your `*.herokuapp.com`
from search engine results.
Use case
--------
You want to develop a website called `artisanalraisinbeer.com` using
Django deployed on Heroku. You write a little bit of Django code and
create a new Heroku app called `artisanalraisinbeer` to deploy to.
While developing, you can visit your site by going to this URL:
http://artisanalraisinbeer.herokuapp.com
Eventually, you finish the first version of your website, buy the
domain name `artisanalraisinbeer.com`, and set everything up
so that you can view the site just by going to the following URL:
http://www.artisanalraisinbeer.com
You can still visit `http://artisanalraisinbeer.herokuapp.com`, which
is fine—but there's one problem: you want your main site to show
up in search results, *not* your `.herokuapp.com` site.
How it works
------------
This app goes about this two ways: [robots.txt](http://www.robotstxt.org/robotstxt.html)
and the [X-Robots-Tag](https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag).
Why both? _To be double-plus sure..._ :eyes:
If `herokuapp` seems to be in the [originating host](https://docs.djangoproject.com/en/1.7/ref/request-response/#django.http.HttpRequest.get_host)
of the user request, then we do two things:
* Put the following in `robots.txt`:
```
User-agent: *
Disallow: /
```
* Set `X-Robots-Tag` in our response header to `noindex, nofollow`.
For search engines that respect these settings, they should start to ignore these sites
in future crawls.
Quick start
-----------
1. Add `'hide_herokuapp'` to your INSTALLED_APPS setting.
2. Add the `HideHerokuappFromRobotsMiddleware` middleware to your `MIDDLEWARE_CLASSES`
like this:
```
MIDDLEWARE_CLASSES = (
...
'hide_herokuapp.middleware.HideHerokuappFromRobotsMiddleware',
)
```
3. Include the `hide_herokuapp` URLconf in your project `urls.py` like this:
```
urlpatterns = patterns('',
...
url(r'^robots\.txt$', include('hide_herokuapp.urls')),
...
)
```
=====================
Django app for Heroku users designed to hide your `*.herokuapp.com`
from search engine results.
Use case
--------
You want to develop a website called `artisanalraisinbeer.com` using
Django deployed on Heroku. You write a little bit of Django code and
create a new Heroku app called `artisanalraisinbeer` to deploy to.
While developing, you can visit your site by going to this URL:
http://artisanalraisinbeer.herokuapp.com
Eventually, you finish the first version of your website, buy the
domain name `artisanalraisinbeer.com`, and set everything up
so that you can view the site just by going to the following URL:
http://www.artisanalraisinbeer.com
You can still visit `http://artisanalraisinbeer.herokuapp.com`, which
is fine—but there's one problem: you want your main site to show
up in search results, *not* your `.herokuapp.com` site.
How it works
------------
This app goes about this two ways: [robots.txt](http://www.robotstxt.org/robotstxt.html)
and the [X-Robots-Tag](https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag).
Why both? _To be double-plus sure..._ :eyes:
If `herokuapp` seems to be in the [originating host](https://docs.djangoproject.com/en/1.7/ref/request-response/#django.http.HttpRequest.get_host)
of the user request, then we do two things:
* Put the following in `robots.txt`:
```
User-agent: *
Disallow: /
```
* Set `X-Robots-Tag` in our response header to `noindex, nofollow`.
For search engines that respect these settings, they should start to ignore these sites
in future crawls.
Quick start
-----------
1. Add `'hide_herokuapp'` to your INSTALLED_APPS setting.
2. Add the `HideHerokuappFromRobotsMiddleware` middleware to your `MIDDLEWARE_CLASSES`
like this:
```
MIDDLEWARE_CLASSES = (
...
'hide_herokuapp.middleware.HideHerokuappFromRobotsMiddleware',
)
```
3. Include the `hide_herokuapp` URLconf in your project `urls.py` like this:
```
urlpatterns = patterns('',
...
url(r'^robots\.txt$', include('hide_herokuapp.urls')),
...
)
```
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-hide-herokuapp-0.1.tar.gz.
File metadata
- Download URL: django-hide-herokuapp-0.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32a660e145510fb7636fd24c731c11482af4e879f735a3fac7fa6a5fc318c73b
|
|
| MD5 |
9680e33722caecd120df0b6a38379980
|
|
| BLAKE2b-256 |
5c0ab1c2a03f6352c2837788b21231b777d8346ee6c7574793e41da659ec8457
|
File details
Details for the file django_hide_herokuapp-0.1-py2-none-any.whl.
File metadata
- Download URL: django_hide_herokuapp-0.1-py2-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8d776a3930073cafc139a542625f2750685c735bf733e280609506869b0810e
|
|
| MD5 |
75307859a4b9718dbb61183abe3906c4
|
|
| BLAKE2b-256 |
fc9b8d042a1d8570e2178e417cfabb6e63312f13c86835a38dd76c7fd00f1e08
|