RewriteRule (.*) http://mysite.ru/$1\?city=%1 [L,QSA]
nginx.service - nginx - high performance web server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2017-07-07 16:56:21 MSK; 2 weeks 5 days ago
Docs: http://nginx.org/en/docs/
Process: 4901 ExecStop=/bin/kill -s QUIT $MAINPID (code=exited, status=0/SUCCESS)
Process: 8526 ExecReload=/bin/kill -s HUP $MAINPID (code=exited, status=0/SUCCESS)
Process: 4908 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
Process: 4906 ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
Main PID: 4910 (nginx)
CGroup: /system.slice/nginx.service
├─4910 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
├─8529 nginx: worker process
├─8530 nginx: worker process
├─8531 nginx: worker process
├─8532 nginx: worker process
├─8533 nginx: worker process
├─8534 nginx: worker process
├─8535 nginx: worker process
└─8536 nginx: worker process
в”њв”Ђ17082 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
# проверяем есть ли еще что-то после каталога
RewriteCond %{REQUEST_URI} (.*)binty-poliuritanovye/(.+)$ [NC]
# это не физический файл
RewriteCond %{REQUEST_FILENAME} !-f
# Проверяем, оканчивается ли запрашиваемый url на .html и до него есть что-то. и еще и регистронезависимо
RewriteCond %{REQUEST_URI} ^.*([^/].+)\.html$ [NC]
# Теперь переписываем url, удаляя суффикс
# Выделяем шаблон для обработки, и подставляем её же без html
RewriteRule ^(.*)$ %1/ [R=301,L]
# Use the front controller as index file. It serves as fallback solution when
# every other rewrite/redirect fails (e.g. in an aliased environment without
# mod_rewrite). Additionally, this reduces the matching process for the
# startpage (path "/") because otherwise Apache will apply the rewritting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
# Block access to AVCMS code folders
RewriteRule ^(src/|cache/|webmaster/(?!templates)|vendor/) - [F,L,NC]
# Determine the RewriteBase automatically and set it as environment variable.
# If you are using Apache aliases to do mass virtual hosting or installed the
# project in a subdirectory, the base path will be prepended to allow proper
# resolution of the app.php file and to redirect to the correct URI. It will
# work in environments without path prefix as well, providing a safe, one-size
# fits all solution. But as you do not need it in this case, you can comment
# the following 2 lines to eliminate the overhead.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteCond %{REQUEST_URI} !^/install\.php$
RewriteRule ^(.*) - [E=BASE:%1]
# Redirect to URI without front controller to prevent duplicate content
# (with and without `/app.php`). Only do this redirect on the initial
# rewrite by Apache and not on subsequent cycles. Otherwise we would get an
# endless redirect loop (request -> rewrite to front controller ->
# redirect -> request -> ...).
# So in case you get a "too many redirects" error or you always get redirected
# to the startpage because your Apache does not expose the REDIRECT_STATUS
# environment variable, you have 2 choices:
# - disable this feature by commenting the following 2 lines or
# - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
# following RewriteCond (best solution)
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^index\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
# If the requested filename exists, simply serve it.
# We only want to let Apache serve files and not directories.
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]
# Rewrite all other queries to the front controller.
RewriteCond %{REQUEST_URI} !^/install\.php$
RewriteRule .? %{ENV:BASE}/index.php [L]
</IfModule>
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
# When mod_rewrite is not available, we instruct a temporary redirect of
# the startpage to the front controller explicitly so that the website
# and the generated links can still be used.
RewriteCond %{REQUEST_URI} !^/install\.php$
RewriteRule ^/$ /index.php/ [R=302,L]
# RedirectTemp cannot be used instead
</IfModule>
</IfModule>
<Files ~ "\.(yml|twig)$|composer.json|composer.lock">
order deny,allow
deny from all
</Files>
RewriteRule ^game/(.*)/$ game.php?do=$1
RewriteRule ^game/(.+)^[/]$ game.php?do=$1
.*
на.+
RewriteRule ^gamefeed(/|)$ api.php?type=game_feed
(\|) - или слеш или конец строки.RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
#RewriteRule ^play/(.+)-(.+).html$ play.php?slug=$1&id=$2
RewriteRule ^page/(.+)-(.+)\.html$ page.php?slug=$1&id=$2
#RewriteRule ^category/(.*)/$ category.php?name=$1
RewriteRule ^category/(.*)$ category.php?name=$1
#RewriteRule ^user/(.*)/$ profile.php?name=$1
RewriteRule ^user/(.*)$ profile.php?name=$1
#RewriteRule ^game/(.*)/(.*)/$ game.php?do=$1&id=$2
RewriteRule ^game/(.+)/(.+)$ game.php?do=$1&id=$2
#RewriteRule ^game/(.*)/$ game.php?do=$1
RewriteRule ^game/(.+)$ game.php?do=$1
#RewriteRule ^panel/(.*)/(.*)/(.*)/$ panel.php?page=$1&type=$2&id=$3
RewriteRule ^panel/(.+)/(.+)/(.+)$ panel.php?page=$1&type=$2&id=$3
#RewriteRule ^panel/(.*)/(.*)/$ panel.php?page=$1&type=$2
RewriteRule ^panel/(.+)/(.+)$ panel.php?page=$1&type=$2
#RewriteRule ^login/(.*)/(.*)/$ login.php?type=$1&code=$2
RewriteRule ^login/(.+)/(.+)$ login.php?type=$1&code=$2
#RewriteRule ^login/(.*)/$ system/external/OAuth/login.php?app=$1
RewriteRule ^login/(.+)$ system/external/OAuth/login.php?app=$1
RewriteRule ^embed/game/(.*)$ api.php?type=game_embed&id=$1
#RewriteRule ^embed/game/(.*)/$ api.php?type=game_embed&id=$1
RewriteRule ^api/user/(.+)$ api.php?type=user_data&id=$1
#RewriteRule ^data/user/(.*)/$ api.php?type=user_data&id=$1
RewriteRule ^gamefeed(/|)$ api.php?type=game_feed
#RewriteRule ^gamefeed$ api.php?type=game_feed
RewriteRule ^gamefeed/(.+)$ api.php?type=game_feed&$1
#RewriteRule ^language/(.*)/$ language.php?code=$1
RewriteRule ^language/(.+)$ language.php?code=$1
#RewriteRule ^forgot/(.*)/(.*)/(.*)/$ forgot.php?do=$1&forgotcode=$2&email=$3
RewriteRule ^forgot/(.+)/(.+)/(.+)$ forgot.php?do=$1&forgotcode=$2&email=$3
#ewriteRule ^arcanox/(.*)/(.*)/$ arcanox.php?type=$1&password=$2
RewriteRule ^arcanox/(.+)/(.+)$ arcanox.php?type=$1&password=$2
#RewriteRule ^warning/(.*)/$ error.php?type=$1
RewriteRule ^warning/(.+)$ error.php?type=$1
#RewriteRule ^search/(.+)/$ search.php?s=$1
RewriteRule ^search/(.*)$ search.php?s=$1
RewriteRule ^register/(.*)$ register.php$1
RewriteRule ^system/language.js$ system/external/language.php
RewriteRule ^system/captcha.png$ system/external/captcha.php
RewriteRule ^warning/$ error.php
RewriteRule ^warning$ error.php
RewriteRule ^pending$ pending.php
RewriteRule ^panel$ panel.php
RewriteRule ^favorites$ favorites.php
RewriteRule ^settings$ settings.php
RewriteRule ^profile$ profile.php
RewriteRule ^leaderboard$ leaderboard.php
RewriteRule ^login$ login.php
RewriteRule ^forgot$ forgot.php
RewriteRule ^register$ register.php
RewriteRule ^logout$ logout.php
# 1. Удалить www
RewriteCond %{ENV:HTTPS} on
#Если включен https
RewriteRule .* - [E=SSL:s]
#То создаем переменную ssl с текстом s
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
# Проверяем, содержит ли домен www в начале URL.
RewriteCond %{REQUEST_URI} !^/robots\.txt$
# и не робот
RewriteRule ^(.*)$ http%{ENV:SSL}://%1/$1 [R=301,L]
# Перенаправляем удаляем www
# 2. Добавить www
RewriteCond %{ENV:HTTPS} on
#Если включен https
RewriteRule .* - [E=SSL:s]
#То создаем переменную ssl с текстом s
RewriteCond %{HTTP_HOST} !^www\.(.*) [NC]
# Если нет www в начале домена
RewriteCond %{REQUEST_URI} !^/robots\.txt$
# и не робот
RewriteRule ^(.*)$ http%{ENV:SSL}://www.%{HTTP_HOST}/$1 [R=301,L]
#Подставляем www и https если он включен.