Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
* Added a safer default robots.txt template
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Welch committed Jun 20, 2017
1 parent 104d857 commit 3dec050
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.1.48 - 2017.06.18
### Changed
* Fixed an issue on old versions of PHP < PHP 5.4 with `http_response_code()`
* Added a safer default `robots.txt` template

## 1.1.47 - 2017.06.08
### Changed
Expand Down
3 changes: 2 additions & 1 deletion releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"downloadUrl": "https://github.com/nystudio107/seomatic/archive/master.zip",
"date": "2017-06-18T11:00:00-11:00",
"notes": [
"[Fixed] Fixed an issue on old versions of PHP < PHP 5.4 with `http_response_code()`"
"[Fixed] Fixed an issue on old versions of PHP < PHP 5.4 with `http_response_code()`",
"[Improved] Added a safer default `robots.txt` template"
]
},
{
Expand Down
10 changes: 9 additions & 1 deletion templates/_robotsDefault.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# robots.txt for {{ siteUrl }}
# For a multi-environment setup, see: https://nystudio107.com/blog/prevent-google-from-indexing-staging-sites

Sitemap: {{ siteUrl |trim('/') }}/sitemap.xml

# Don't allow web crawlers to index Craft
{% if craft.config.devMode %}
# devMode - disallow all

User-agent: *
Disallow: /
{% else %}
# Live - Don't allow web crawlers to index Craft

User-agent: *
Disallow: /craft/
{% endif %}

0 comments on commit 3dec050

Please sign in to comment.