diff --git a/README.md b/README.md index 8e41ac7..1302ace 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ RewriteRule pattern substitution [flags] RewriteRule ^old-path/(.*)$ /new-path/$1 [R=301,L] # Condition-based rewrite (chain) -RewriteCond %REQUEST_URI !^/admin/ +RewriteCond %{REQUEST_URI} !^/admin/ RewriteRule ^admin/(.*)$ /login.php?user=$1 [NC,E,END] # In .htaccess: @@ -141,18 +141,14 @@ RewriteCond input_string pattern [flags] **Examples:** ```nginx # Condition: file exists -RewriteCond %REQUEST_FILENAME -f +RewriteCond %{REQUEST_FILENAME} -f # Condition: not a directory -RewriteCond %REQUEST_FILENAME !-d +RewriteCond %{REQUEST_FILENAME} !-d # Condition: string comparison RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] -# Integer comparison (file size > 1024 bytes) -RewriteCond %REQUEST_FILENAME -s -RewriteCond %{FILESIZE} -gt 1024 - # Multiple conditions with OR logic RewriteCond %{HTTP_HOST} ^www\.example\.com$ [OR] RewriteCond %{HTTPS} off diff --git a/README.ru.md b/README.ru.md index f9644ac..dc5f409 100644 --- a/README.ru.md +++ b/README.ru.md @@ -97,7 +97,7 @@ RewriteRule pattern substitution [flags] RewriteRule ^old-path/(.*)$ /new-path/$1 [R=301,L] # Условное переписывание (цепочка) -RewriteCond %REQUEST_URI !^/admin/ +RewriteCond %{REQUEST_URI} !^/admin/ RewriteRule ^admin/(.*)$ /login.php?user=$1 [NC,E,END] # В .htaccess: @@ -143,18 +143,14 @@ RewriteCond input_string pattern [flags] **Примеры:** ```nginx # Условие: файл существует -RewriteCond %REQUEST_FILENAME -f +RewriteCond %{REQUEST_FILENAME} -f # Условие: не директория -RewriteCond %REQUEST_FILENAME !-d +RewriteCond %{REQUEST_FILENAME} !-d # Сравнение строк RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] -# Сравнение целых чисел (размер файла > 1024 байт) -RewriteCond %REQUEST_FILENAME -s -RewriteCond %{FILESIZE} -gt 1024 - # Множественные условия с OR RewriteCond %{HTTP_HOST} ^www\.example\.com$ [OR] RewriteCond %{HTTPS} off