AuthName "Please enter your credentials. Website is available only to authorized users."
AuthType Basic
AuthUserFile /var/www/html/master/.htpasswd
<RequireAny>
Require valid-user
Require expr %{THE_REQUEST}=~m#^\S+\s/api#
</RequireAny>
AuthName "Please enter your credentials. Website is available only to authorized users."
AuthType Basic
AuthUserFile /var/www/html/master/.htpasswd
Require valid-user
Satisfy Any
SetEnvIf Request_URI ^/api api_allow=1
Order Allow,Deny
Allow from env=api_allow
Allow from env=redirect_api_allow
Страница выдала "слишком много перенаправлений"
RewriteEngine On
RewriteRule ^(.*)$ https://new-domain.ru/$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?old-domain\.ru$ [NC]
RewriteRule ^(.*)$ https://new-domain.ru/$1 [R=301,L]
https://old-domain.ru
на https://new-domain.ru
RewriteEngine On
добавить RewriteRule ^index\.php/(.*) http://site.local/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule .* http://site.local/$0 [R=301,L]
RewriteEngine on
# site1.ru/cat/ -> site2.ru/cat2
RewriteRule ^cat/$ https://site2.ru/cat2 [R=301,L]
# site1.ru/cat/item -> site2.ru/item
RewriteRule ^cat/(.+)$ https://site2.ru/$1 [R=301,L]
# site1.ru -> site2.ru
# site1.ru/%любая_другая_страница% -> site2.ru
RewriteRule ^ https://site2.ru [R=301,L]
RewriteRule ^catalog/(.+)/page/([0-9]+)$ catalog.php?url=$1&page=$2 [L]
RewriteRule ^catalog/(.+)$ catalog.php?url=$1 [L]
RewriteEngine on
RewriteRule ^games/(games/StreamingAssets/aa/settings\.json)$ https://site.com/$1 [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{QUERY_STRING} (?:^|&)q=%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D0%B8-%D0%94%D0%B5%D1%82%D1%81%D0%BA%D0%B8%D0%B5\+%D0%BA%D1%80%D0%BE%D0%B2%D0%B0%D1%82%D0%BA%D0%B8(?:$|&)
RewriteRule ^2-glavnaya$ /? [R=301,L]
RewriteRule ^articles/\xAA\xDD/$ /articles/ [L,R=301]
RewriteRule ^articles/.*[^\s\w/] /articles/ [L,R=301]
/.htaccess
RewriteEngine On
RewriteRule .* frontend/$0 [L]
/frontend/.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.html [L]
/api/.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
<Files "users.json">
deny from all
</Files>
^amp
будет работать в RewriteRule, а для RedirectMatch нужно добавить "/" ^/amp
RedirectMatch 301 ^/amp/[0-9]*\.html$ https://site.ru/
RewriteRule ^amp/[0-9]*\.html$ https://site.ru/ [R=301,L]
AddDefaultCharset UTF-8
RewriteEngine On
RewriteCond %{HTTP_REFERER} ok\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} mamba\.ru [NC,OR]
RewriteCond %{HTTP_REFERER} facebook\.com [NC]
RewriteRule ^ - [F]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /doma/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /doma/index.php [L]
</IfModule>
# END WordPress