b/
и b/index.php
подходят под шаблон ^b/(.*)$
и происходит зацикливание.# c
RewriteRule ^(.*)/$ ?q=$1 [QSA,L]
b/
.# api
RewriteRule ^b/(.*)/$ /b/index.php?q=$1 [QSA,L]
# other
RewriteRule ^(.*)/$ /index.php?q=$1 [QSA,L]
http://localhost:8080/
, то в переменной %{HTTP_HOST} будет localhost:8080
http://127.0.0.1:8080/
, то в %{HTTP_HOST} будет 127.0.0.1:8080
RewriteCond %{HTTP_HOST} !^(127\.0\.0\.1|localhost)
proxy_pass http://127.0.0.1:8080
############################################################################ #### Убираем index.php, если он есть в конце URL #### ############################################################################ RewriteCond %{REQUEST_URI} ^(.*)/index\.php$ # URL cодержит index.php в конце. RewriteCond %{REQUEST_METHOD} =GET # Выявляем GET запрос в URL (не POST). RewriteRule ^(.*)$ %1/ [R=301,L] # Удалить index.php из URL
############################################################################ #### Это ЧПУ движка оно должно быть в самом низу #### ############################################################################ RewriteCond %{REQUEST_FILENAME} !-f # если это не файл RewriteCond %{REQUEST_FILENAME} !-d # если это не директория RewriteRule . index.php # То перенаправить на индекс пхп
const str = "aasg assg gsaa gggh";
const word = "sgaa";
const c = [...word].reduce(function (a, e) {
a.hasOwnProperty(e) && (++a[e]) || (a[e] = 1);
return a;
}, {});
let pattern = "\\b";
for (const letter in c) {
pattern += `(?=(\\w*${letter}){${c[letter]}})`
}
pattern += `[${word}]{${word.length}}\\b`
const re = new RegExp(pattern, 'g')
console.log(str.match(re))
/\b(?=(\w*s){1})(?=(\w*g){1})(?=(\w*a){2})[sgaa]{4}\b/g
// Первый и последний симолы
let rbwFirstLetter = s.match(regularBadWord);
let rbwLastLetter = regularBadWord[-1];
s = s.replace(regularBadWord, m => '*'.repeat(m.length) );
console.log(rbwFirstLetter);
console.log(rbwLastLetter);
s = s.replace(regularBadWord, function (m) {
let rbwFirstLetter = m[0];
let rbwLastLetter = m[m.length-1];
console.log(rbwFirstLetter, rbwLastLetter);
return '*'.repeat(m.length);
})
m => '*'.repeat(m.length)
function (m) { return '*'.repeat(m.length)}
RewriteEngine On Redirect 301 https://old.com/new-com https://new.com RewriteCond %{HTTP_HOST} ^new\.com$ [NC] RewriteRule ^(.*)$ https://new.com/new-com/ [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^new\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/new-com/
RewriteRule ^(.*)$ /new-com/$1 [L]
preg_match_all('/<a\s[^>]*href="([^"]+)"[^>]*>\s*\[photo-[^<]*<\/a>/i', $data, $result);
sandbox.onlinephpfunctions.com/code/5c151ab1d656e7...