Redirect 301 /o-kompanii/novosti/motorezina-na-lyuboy-vkus/ /company/news/motorezina_na_lyuboy_vkus/
Redirect 301 /o-kompanii/novosti/podbor-zapchastey-po-artikulu/ /company/news/podbor_zapchastey_po_artikulu/
Redirect 301 /o-kompanii/novosti/bystraya-dostavka/ /company/news/bystraya_dostavka/
Redirect 301 /o-kompanii/novosti/poshiv-ekipirovki-tschul-po-vashim-parametram-pod-zakaz/ /company/news/poshiv_ekipirovki_tschul_po_vashim_parametram_pod_zakaz/
Redirect 301 /o-kompanii/novosti/aktsiya-na-produktsiyu-motul/ /company/news/aktsiya_na_produktsiyu_motul/
Redirect 301 /o-kompanii/novosti/postuplenie-shlemov-hjc/ /company/news/postuplenie_shlemov_hjc/
Redirect 301 /o-kompanii/novosti/ /company/news/
Redirect 301 /o-kompanii/otzyvy-pokupateley.php /company/reviews/
Redirect 301 /o-kompanii/ /company/
Redirect 301 /dostavka-oplata/dostavka-po-rossii.php /help/delivery/
Redirect 301 /dostavka-oplata/oplata.php /help/payment/
Redirect 301 /dostavka-oplata/ /help/
Redirect 301 /pokupatelyam/obmen-i-vozvrat.php /help/warranty/
Redirect 301 /pokupatelyam/tablici-razmerov.php /help/tablitsa-razmerov/
Redirect 301 /pokupatelyam/zaschita-prav-polzovateley.php /include/licenses_detail.php
Redirect 301 /pokupatelyam/ /help/warranty/
Redirect 301 /kontakty/ /contacts/
Redirect 301 /cart/ /basket/
Redirect 301 /account/spisok-sravneniya/ /catalog/compare.php
Redirect 301 /account/ /personal/
Redirect 301 /brandy/ /info/brands/
Redirect 301 /o-kompanii/ /company/
server {
listen 80;
server_name mydomain.ru;
return 301 http://www.mydomain.ru$request_uri;
}
server {
listen 80;
server_name www.mydomain.ru;
root /path/to/site;
index index.php index.html;
rewrite "^/404/{0,1}$" /index.php?module=sitemap break;
rewrite "^/adm/{0,1}$" /admin.php break;
rewrite "^/adm/([a-zA-Z0-9_-]+)/{0,1}$" /admin.php?module=$1 break;
rewrite "^/adm/([a-zA-Z0-9_-]+)/([0-9]+)/{0,1}$" /admin.php?module=$1&page=$2 break;
rewrite "^/adm/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/{0,1}$" /admin.php?module=$1&p1=$2 break;
rewrite "^/adm/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/{0,1}$" /admin.php?module=$1&p1=$2&p2=$3 break;
if (!-e $request_filename){
rewrite "^/([a-zA-Z0-9_-]+).html/{0,1}$" /index.php?module=static&p1=$1 break;
}
if (!-e $request_filename){
rewrite "^/([a-zA-Z0-9_-]+)/{0,1}$" /index.php?module=$1 break;
}
rewrite "^/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/{0,1}$" /index.php?module=$1&p1=$2 break;
rewrite "^/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/{0,1}$" /index.php?module=$1&p1=$2&p2=$3 break;
rewrite "^/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/{0,1}$" /index.php?module=$1&p1=$2&p2=$3&p3=$4 break;
location ~ \.php$ {
fastcgi_pass ... ;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(catalog)/(perchatki/.*)$ /$1/ekipirovka/$2 [R=301,L]
# ASPRO_ROBOTS Serve robots.txt with robots.php only if the latter exists
RewriteCond %{REQUEST_FILENAME} robots.txt
RewriteCond %{DOCUMENT_ROOT}/robots.php -f
RewriteRule ^(.*)$ /robots.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
RewriteRule ^(catalog)/(perchatki/.*)$ /$1/ekipirovka/$2 [R=301,L]
# ASPRO_ROBOTS Serve robots.txt with robots.php only if the latter exists
RewriteCond %{REQUEST_FILENAME} robots.txt
RewriteCond %{DOCUMENT_ROOT}/robots.php -f
RewriteRule ^(.*)$ /robots.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
DirectorySlash off
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/$1 -d
RewriteRule ^(.*[^/])$ https://site.ru/$1/ [R=301,L]
RewriteRule ^(|.+/)index\.html$ https://site.ru/$1 [R=301,L]
RewriteCond %{ENV:HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ https://site.ru/$1 [R=301,L]
DirectorySlash off
RewriteCond %{DOCUMENT_ROOT}/$1/index.html -f
RewriteRule ^(.+)$ /$1/index.html [L]
DirectorySlash off
http://
на https://
RewriteCond %{HTTP_HOST} ^www\.(.*)$ RewriteRule ^(.*)$ http://%1/$1 [L,R=301]
if ($request ~ "^GET ([^?]*/)index\.(?:php|html)(.*)") {
return 301 $1$2;
}
(?!/administrator)
if ($request ~ "^GET ([^?]*/)index\.(?:php|html)") {
return 301 $1;
}
if (!-d $request_filename){
rewrite ^/(.*)/$ /$1 redirect;
}
set $root_path /sites/example.com;
root $root_path;
!-d
стоит раньше чем устанавливается значение $root_path и root.server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
server_name example.com www.example.com;
set $root_path /sites/example.com;
root $root_path;
access_log /var/log/nginx/example.access.log main;
ssl_certificate /etc/nginx/ssl/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/privkey.pem;
if ($host ~* www\.(.*)) {
set $host_without_www $1;
rewrite ^(.*)$ http://$host_without_www$1 permanent;
}
if ($request_uri ~ "^(.*)index\.(?:php|html)") {
return 301 $1;
}
if (!-d $request_filename){
rewrite ^/(.*)/$ /$1 redirect;
}
gzip on;
gzip_disable "msie6";
gzip_min_length 1000;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $root_path$fastcgi_script_name;
include fastcgi_params;
}
server { }
и заходить на 192.168.1.5/test