Prevent robots from indexing file download links

https://xetown.com/topics/1708853
This commit is contained in:
Kijin Sung 2022-09-16 16:55:50 +09:00
parent df56b7f8b1
commit 772d26ee2f

View file

@ -393,6 +393,8 @@ class fileController extends file
{
$url = getNotEncodedUrl('', 'module', 'file', 'act', 'procFileOutput', 'file_srl', $file_srl, 'file_key', $file_key, 'force_download', Context::get('force_download') === 'Y' ? 'Y' : null);
}
header('X-Robots-Tag: noindex');
header('Location: ' . $url);
Context::close();
exit();
@ -535,6 +537,7 @@ class fileController extends file
header('Content-Length: ' . $range_length);
header('Accept-Ranges: bytes');
header('Etag: "' . $etag . '"');
header('X-Robots-Tag: noindex');
// Print the file contents
for($offset = 0; $offset < $range_length; $offset += 4096)