RewriteRule ^(.*)$ ./index.php?page=$1
RewriteRule ^([^/.]+)/(\d+)$ index.php?page=$1&i=$2
RewriteRule ^([^/.]+)/?$ index.php?page=$1
RewriteCond page=$1&i=$2 ^(.+=[^&]+)
RewriteRule ^([^/.]+)(?:/(\d*))?$ index.php?%1
<Files "protected_file.php">
AuthName "Member Only"
AuthType Basic
AuthUserFile /etc/apache2/.htpasswd
require user Vasily
Satisfy All
</Files>
Satisfy Any
AuthName "Member Only"
AuthType Basic
AuthUserFile /etc/apache2/.htpasswd
require valid-user
Satisfy All
<div class="header-info-box">\K((?:[^<]|(?!</?div).|<div(?1)</div>)*+)
<div class="hello"></div>
Header set Content-Disposition attachment "expr=%{QUERY_STRING} == 'download=1'"
Header set Content-Disposition attachment env=attach
RewriteCond %{QUERY_STRING} =download=1
RewriteRule ^ - [E=attach:1]
ServerName domain.ru
ServerAlias *.domain.ru
ServerSignature Off
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain\.ru [NC]
RewriteRule ^/(.*) http://www.domain.ru/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^(www\.)?+.+\.domain\.ru$ [NC]
RewriteRule ^/(.*)\.html$ /index.php?page=$1 [L]
<link rel="icon" href="/someimage.ico" />
RewriteCond %{REQUEST_URI} !/test\.php
RewriteRule .* test.php
/favicon.ico
будет вызван test.php.$log = date('H:i:s ') . $_SERVER['REQUEST_URI'] . PHP_EOL;
file_put_contents('log.txt', $log, FILE_APPEND);
RewriteEngine On
RewriteCond %{THE_REQUEST} " /start\.php\?id=(123456) "
RewriteRule ^ https://my-bot.ru/start/id/%1? [R=301,L]
RewriteRule ^start/id/(123456)$ /start.php?id=$1 [L]
# Бан "плохих" ботов для снижения нагрузки на серверп RewriteCond %{HTTP_USER_AGENT} (AhrefsBot|MJ12bot|DotBot|BUbiNG\ Crawler|BUbiNG|FaceBook\ Crawler|FaceBook|SemrushBot|LinkdexBot|Alexa\ Robot|Alexa|Ads.txt-crawler|Powermarks|GrapeshotCrawler|grapeshot|SimplePie|360Spider|CCBot|SeznamBot|LinkpadBot|BLEXBot) [NC] RewriteRule .* - [R=403,L] # Обратная совместимость со старыми страницами RewriteRule ^pages/(.*)$ /page/$1 [L,R=301] # Редирект с WWW RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
server {
listen ip:80;
server_name www.111.com;
return 301 http://111.com$request_uri;
}
server {
listen ip:80;
server_name 111.com;
if ($http_user_agent ~* "(AhrefsBot|MJ12bot|DotBot|BUbiNG\ Crawler|BUbiNG|FaceBook\ Crawler|FaceBook|SemrushBot|LinkdexBot|Alexa\ Robot|Alexa|Ads.txt-crawler|Powermarks|GrapeshotCrawler|grapeshot|SimplePie|360Spider|CCBot|SeznamBot|LinkpadBot|BLEXBot)") {
return 403;
}
rewrite ^/pages/(.*)$ /page/$1 permanent;
server {
listen ip:80;
server_name 111.com www.111.com;
%XX
RewriteRule ^наши-услуги/оценка-жилой-недвижимости/оценка-доли-в-квартире/$ https://psocenka.ru/ocenka-doli-v-kvartire [R=301,L]
server {
listen 80;
listen [::]:80; #Added IPv6 here too
# for certbot
location ^~ /.well-known/acme-challenge/ {
root /etc/nginx/ssl/coins;
}
location / {
return 301 https://my.cryptonot.io$request_uri;
}
}
RewriteRule ^/
/
In VirtualHost context, The Pattern will initially be matched against the part of the URL after the hostname and port, and before the query string (e.g. "/app1/index.html"). This is the (%-decoded) URL-path.
In per-directory context (Directory and .htaccess), the Pattern is matched against only a partial path, for example a request of "/app1/index.html" may result in comparison against "app1/index.html" or "index.html" depending on where the RewriteRule is defined.