console.log(Number.MAX_SAFE_INTEGER)
//9007199254740991
const array = [9, 2, 2, 3, 3, 7, 2, 0, 3, 6, 8, 5, 4, 7, 7, 5 , 6,7,7];
const number = BigInt(array.join(''));
console.log(number.toString());
class SitemapImageBuilder
{
public function __construct(string $imagesDir)
{
$this->dir = $imagesDir;
}
public function run()
{
$imageFiles = $this->getImageFiles($this->dir);
$this->generateXml($imageFiles);
}
public function getImageFiles(string $path)
{
$ret = [];
$files = scandir($path);
$explodeNames = [
'.',
'..',
];
$mimeRe = "/^image/";
foreach ($files as $name) {
if (in_array($name, $explodeNames)) {
continue;
}
$filePath = $path .'/'. $name;
if (is_dir($filePath)) {
$childs = $this->getImageFiles($filePath);
if ($childs) {
array_push($ret, ...$childs);
}
}
else if (is_file($filePath)) {
$mime = mime_content_type($name);
if (preg_match($mimeRe, $mime)) {
$ret[] = $filePath;
}
}
}
return $ret;
}
public function generateXml(array $pathes)
{
// генерация XML sitemap
}
}
$imagesDir = 'path/to/static';
(new SitemapImageBuilder($imagesDir))->run();
DirectorySlash Off
ErrorDocument 404 /404.html
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} "^\S+ /([^?.]+)\.html"
RewriteRule ^(?:index|([^.]+))\.html$ https://zaoks.ru/$1 [R=301,L]
RewriteCond %{HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ https://zaoks.ru/$1 [R=301,L]
RewriteCond %{DOCUMENT_ROOT}/$1.html -f
RewriteRule ^([^.]+)$ /$1.html [L]
<Files ~ "\.pdf$">
Header set X-Robots-Tag "noindex, nofollow"
</Files>