SetEnvIfNoCase User-Agent yandex AllowGroup
RewriteCond %{ENV:AllowGroup} ^$
RewriteCond %{REQUEST_URI} !zaglushka
RewriteRule .* https://%{SERVER_NAME}/zaglushka [R=301,L]
Cкрыть сайт от всех пользователей, кроме поисковых роботов
function SquareImage($imgSrc, $imgDes, $thumbSize = 1000){
list($width, $height) = getimagesize($imgSrc);
$myImage = imagecreatefromjpeg($imgSrc);
if ($width > $height) {
$y = 0;
$x = ($width - $height) / 2;
$smallestSide = $height;
$top = ($thumbSize - $height) / 2;
$left = 0;
} else {
$x = 0;
$y = ($height - $width) / 2;
$smallestSide = $width;
$top = 0;
$left = ($thumbSize - $width) / 2;
}
$thumb = imagecreatetruecolor($thumbSize, $thumbSize);
$white = imagecolorallocate($thumb, 255, 255, 255);
imagefill($thumb, 0, 0, $white);
imagecopyresampled($thumb, $myImage, $left, $top, $x, $y, $thumbSize, $thumbSize, $smallestSide, $smallestSide);
if (file_exists($imgSrc)) {
unlink($imgSrc);
}
imagejpeg($thumb, $imgDes, 100);
@imagedestroy($myImage);
@imagedestroy($thumb);
}