Documentaion fixes
This commit is contained in:
10
README.md
10
README.md
@@ -96,7 +96,7 @@ RewriteRule pattern substitution [flags]
|
|||||||
RewriteRule ^old-path/(.*)$ /new-path/$1 [R=301,L]
|
RewriteRule ^old-path/(.*)$ /new-path/$1 [R=301,L]
|
||||||
|
|
||||||
# Condition-based rewrite (chain)
|
# Condition-based rewrite (chain)
|
||||||
RewriteCond %REQUEST_URI !^/admin/
|
RewriteCond %{REQUEST_URI} !^/admin/
|
||||||
RewriteRule ^admin/(.*)$ /login.php?user=$1 [NC,E,END]
|
RewriteRule ^admin/(.*)$ /login.php?user=$1 [NC,E,END]
|
||||||
|
|
||||||
# In .htaccess:
|
# In .htaccess:
|
||||||
@@ -141,18 +141,14 @@ RewriteCond input_string pattern [flags]
|
|||||||
**Examples:**
|
**Examples:**
|
||||||
```nginx
|
```nginx
|
||||||
# Condition: file exists
|
# Condition: file exists
|
||||||
RewriteCond %REQUEST_FILENAME -f
|
RewriteCond %{REQUEST_FILENAME} -f
|
||||||
|
|
||||||
# Condition: not a directory
|
# Condition: not a directory
|
||||||
RewriteCond %REQUEST_FILENAME !-d
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
|
||||||
# Condition: string comparison
|
# Condition: string comparison
|
||||||
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
|
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
|
# Multiple conditions with OR logic
|
||||||
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [OR]
|
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [OR]
|
||||||
RewriteCond %{HTTPS} off
|
RewriteCond %{HTTPS} off
|
||||||
|
|||||||
10
README.ru.md
10
README.ru.md
@@ -97,7 +97,7 @@ RewriteRule pattern substitution [flags]
|
|||||||
RewriteRule ^old-path/(.*)$ /new-path/$1 [R=301,L]
|
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]
|
RewriteRule ^admin/(.*)$ /login.php?user=$1 [NC,E,END]
|
||||||
|
|
||||||
# В .htaccess:
|
# В .htaccess:
|
||||||
@@ -143,18 +143,14 @@ RewriteCond input_string pattern [flags]
|
|||||||
**Примеры:**
|
**Примеры:**
|
||||||
```nginx
|
```nginx
|
||||||
# Условие: файл существует
|
# Условие: файл существует
|
||||||
RewriteCond %REQUEST_FILENAME -f
|
RewriteCond %{REQUEST_FILENAME} -f
|
||||||
|
|
||||||
# Условие: не директория
|
# Условие: не директория
|
||||||
RewriteCond %REQUEST_FILENAME !-d
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
|
||||||
# Сравнение строк
|
# Сравнение строк
|
||||||
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
|
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
|
||||||
|
|
||||||
# Сравнение целых чисел (размер файла > 1024 байт)
|
|
||||||
RewriteCond %REQUEST_FILENAME -s
|
|
||||||
RewriteCond %{FILESIZE} -gt 1024
|
|
||||||
|
|
||||||
# Множественные условия с OR
|
# Множественные условия с OR
|
||||||
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [OR]
|
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [OR]
|
||||||
RewriteCond %{HTTPS} off
|
RewriteCond %{HTTPS} off
|
||||||
|
|||||||
Reference in New Issue
Block a user