mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
closes #732, custom robots.txt
This commit is contained in:
@@ -125,6 +125,14 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form>
|
||||
<h3>Web Crawler Settings</h3>
|
||||
<div class="alert alert-warning">
|
||||
<strong>Custom Robots.txt <small>Leave blank for default</small></strong><br />
|
||||
<textarea class="form-control" data-field="robots.txt"></textarea>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<button class="btn btn-lg btn-primary" id="save">Save</button>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -754,9 +754,14 @@ if(nconf.get('ssl')) {
|
||||
|
||||
app.get('/robots.txt', function (req, res) {
|
||||
res.set('Content-Type', 'text/plain');
|
||||
|
||||
if (meta.config["robots.txt"]) {
|
||||
res.send(meta.config["robots.txt"])
|
||||
} else {
|
||||
res.send("User-agent: *\n" +
|
||||
"Disallow: /admin/\n" +
|
||||
"Sitemap: " + nconf.get('url') + "sitemap.xml");
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/recent.rss', function(req, res) {
|
||||
|
||||
Reference in New Issue
Block a user