$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();
$.ajax({ url: "reg_server.php",
"reg_server.php"
на "reg_server"
RewriteCond %{THE_REQUEST} " (/[^?/]+)\.php"
RewriteCond %{THE_REQUEST} "^GET (/[^?/]+)\.php"
RewriteCond %{SERVER_PORT} !^443$ [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ https://site.ru/$1 [R=301,L]
RewriteCond %{SERVER_PORT} !^443$ [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?>www\.|)(.+) [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{SERVER_PORT}%{HTTP_HOST} !^443(?!www\.) [NC]
RewriteCond %{HTTP_HOST} ^(?>www\.|)(.+) [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{SERVER_PORT}%{HTTP_HOST} ^(?|443www\.(.+)|80(?>www\.|)(.+)) [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^(?>www\.|).+\.site\.ru$ [NC]
RewriteRule ^robots\.txt$ /robots_1.txt [L]
RewriteBase /
...
RewriteBase /dash-dev/dist
...
RewriteRule ^(.*)$ $1.php [L]
и перенаправляет на ajax/signup.php, а после добавления RewriteBase получается /dash-dev/dist/ajax/signup.php и обработка начинается заново с начала .htaccessRewriteRule . /dash-dev/dist [L]
RewriteBase /dash-dev/dist
preg_match('~window\.dataLayer\.push\((\{.*?\})\);~s', $html, $m);
$r = json_decode($m[1]);
var_dump($r);
RewriteCond %{REQUEST_URI} /[^/.]+$
RewriteRule ^(.*)$ https://localhost/$1/ [R=301,L]
RewriteCond %{THE_REQUEST} /index\.php [OR]
RewriteCond %{HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*?)(index\.php|$) https://localhost/$1 [R=301,L]