
htaccess
- 375 ответов
- 0 вопросов
340
Вклад в тег
В качестве значения можно использовать текст, переменные и их комбинации.
Если значение поля заголовка — пустая строка, то поле вообще не будет передаваться проксируемому серверу.
map $uri $a {
default "";
~^/some_uri "Basic YWxhZGRpbjpvcGVuc2VzYW1l";
}
proxy_set_header Authorization $a;
RewriteCond %{QUERY_STRING} (?:^|&)wordfence_lh=
RewriteRule ^ /404.php? [R=301,L]
ErrorDocument 404 /404.php
RewriteCond %{QUERY_STRING} (?:^|&)wordfence_lh=
RewriteRule ^ - [R=404,L]
RewriteCond %{QUERY_STRING} (?:^|&)wordfence_lh=
RewriteRule ^ /404.php? [L]
location ~* \.(jpe?g|gif|png|svg)$ {
if ($arg_moderation = "on") {
rewrite ^ /upload/system/no-avatar.jpg break;
}
}
$dom = new DOMDocument();
$dom->loadHTML($html);
$xpath = new DOMXPath($dom);
$nodes = $xpath->query('//img[contains(@class, "popup-img")]');
foreach($nodes as $node) {
$a = $dom->createElement('a');
$a->setAttribute('class', $node->getAttribute("class"));
$a->setAttribute('title', $node->getAttribute("alt"));
$href = parse_url($node->getAttribute("src"), PHP_URL_PATH);
$a->setAttribute('href', '..' . str_replace('/thumbs/100/', '/', $href));
$a->setAttribute('style', "background: url('..$href'); -webkit-background-size:cover; background-size:cover;");
$node->parentNode->insertBefore($a, $node);
$node->parentNode->removeChild($node);
}
echo $dom->saveHTML();