fix(seo): noindex staging builds by default
- add PUBLIC_ALLOW_INDEXING as an explicit production indexing opt-in - emit robots meta noindex,nofollow unless indexing is enabled - generate robots.txt from the same indexing flag - document staging SEO behavior for migration preview hosts
This commit is contained in:
5 files changed
+43
-7
No files matched your search
@@ -0,0 +1,23 @@
|
||||
const allowIndexing = import.meta.env.PUBLIC_ALLOW_INDEXING === 'true';
|
||||
|
||||
const body = allowIndexing
|
||||
? [
|
||||
'User-agent: *',
|
||||
'Allow: /',
|
||||
'Sitemap: https://www.azinstitute4autism.com/sitemap.xml',
|
||||
''
|
||||
].join('\n')
|
||||
: [
|
||||
'User-agent: *',
|
||||
'Allow: /',
|
||||
'# Staging and migration builds emit meta robots noindex,nofollow.',
|
||||
''
|
||||
].join('\n');
|
||||
|
||||
export function GET() {
|
||||
return new Response(body, {
|
||||
headers: {
|
||||
'Content-Type': 'text/plain; charset=utf-8'
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user