Перейти к публикации

Рекомендованные сообщения

Доброго время суток. Подскажите как заставить работать ЧПУ, при установке dle не в корень сайта, а в папке. Пробовал такую конструкцию вставлять в конфиг сайта в nginx

location /test/ {
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 break;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 break;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 break;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 break;

rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 lastbreak
rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 break;
rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 break;
rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 break;

rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 break;
rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 break;
rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 break;
rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 break;
}

test - это имя папки, не получается, может кто сталкивался?

Ссылка на сообщение
Поделиться на других сайтах
1 час назад, celsoft сказал:

меняйте во всех правилах где /index.php на /test/index.php

заменил, по прежнему с ЧПУ ничего не работает, 

server {
  listen  80;
  server_name site.ru www.site.ru;
  root   /var/www/site.ru/html;
  location / {
    index index.php index.html index.html;
	try_files $uri $uri/ =404;
  }
  error_page  500 502 503 504  /50x.html;
    location = /50x.html {
        root  /usr/share/nginx/html;
    }
	
	location ~* \.(jpg|jpeg|gif|png|bmp|js|css)$ {
        access_log   off;
        expires      30d;
    }
	
	location ~ \.php$ { 
try_files $uri =404; 
fastcgi_pass unix:/run/php-fpm/php-fpm.sock; 
fastcgi_index index.php; 
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
include fastcgi_params; 
}
	
	# Редиректы
	
if ($http_host ~* "^www\.(.*)"){
	set $rule_0 1;
	set $bref_0_0 $1;
}
if ($rule_0 = "1"){
	rewrite ^/(.*)$ http://${bref_0_0}/$1 permanent;
}

if ($uri ~ "^/main/$"){
	set $rule_0 1;
}
if ($rule_0 = "1"){
	rewrite ^/.*$ http://site.ru/? permanent;
}

if ($request_uri ~* "^(.*/)index\.php$") {
        return 301 $1;
    }
	
rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;

# Сам пост
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;

rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;

rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;

# За день
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;

# За весь месяц
rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;

# Вывод за весь год
rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;

# вывод отдельному тегу
rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;

# поиск по доп полям
rewrite "^/xfsearch/(.*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
rewrite "^/xfsearch/(.*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;

# вывод для отдельного юзера
rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;

# вывод всех последних новостей
rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;

# вывод в виде каталога
rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;

# вывод непрочитанных статей
rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;

# вывод избранных статей
rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;

rewrite "^/rules.html$" /index.php?do=rules last;
rewrite "^/statistics.html$" /index.php?do=stats last;
rewrite "^/addnews.html$" /index.php?do=addnews last;
rewrite "^/rss.xml$" /engine/rss.php last;
rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;

if (!-d $request_filename) {
        rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
        rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
}

if (!-f $request_filename) {
        rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
        rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
        rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
}

if (!-f $request_filename) {
        rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
}

location /test/ {
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /test/index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 break;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /test/index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 break;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 break;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /test/index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 break;

rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /test/index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 break;
rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /test/index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 break;
rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 break;
rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /test/index.php?newsid=$2&seourl=$3&seocat=$1 break;

rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /test/index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 break;
rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /test/index.php?newsid=$2&news_page=$1&seourl=$3 break;
rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 break;
rewrite "^/([0-9]+)-(.*).html(/?)+$" /test/index.php?newsid=$1&seourl=$2 break;
}

}

 

Ссылка на сообщение
Поделиться на других сайтах

Полный список правил

rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;

# Сам пост
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;

rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;

rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;

# За день
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;

# За весь месяц
rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;

# Вывод за весь год
rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;

# вывод отдельному тегу
rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;

# поиск по доп полям
rewrite "^/xfsearch/(.*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
rewrite "^/xfsearch/(.*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;

# вывод для отдельного юзера
rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;

# вывод всех последних новостей
rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;

# вывод в виде каталога
rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;

# вывод непрочитанных статей
rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;

# вывод избранных статей
rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;

rewrite "^/rules.html$" /index.php?do=rules last;
rewrite "^/statistics.html$" /index.php?do=stats last;
rewrite "^/addnews.html$" /index.php?do=addnews last;
rewrite "^/rss.xml$" /engine/rss.php last;
rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;

if (!-d $request_filename) {
        rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
        rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
}

if (!-f $request_filename) {
        rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
        rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
        rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
}

if (!-f $request_filename) {
        rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
}

А у вас там что за три строки?

И они должны быть точно выше чем правила для корня. Сервер читает правила по порядку, а не с конца.

Ссылка на сообщение
Поделиться на других сайтах

Добавил в location /test/ все правила для dle, перед /index.php добавил /test/, и вставил их перед правилами для корня, к сожалению все так же, спасибо за то-что попытались помочь

Изменено пользователем venrom
Ссылка на сообщение
Поделиться на других сайтах

получилось вот так 

location ~* (mods) {
	rewrite "^/(.*)/page/([0-9]+)(/?)$" /$1/index.php?cstart=$2 last;
    
        # Сам пост
        rewrite "^/(.*)/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /$1/index.php?subaction=showfull&year=$2&month=$3&day=$4&news_page=$5&cstart=$6&news_name=$7&seourl=$7 last;
        rewrite "^/(.*)/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /$1/index.php?subaction=showfull&year=$2&month=$3&day=$4&news_page=$5&news_name=$6&seourl=$6 last;
        rewrite "^/(.*)/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$2&month=$3&day=$4&news_page=$5&news_name=$6&seourl=$6 last;
        rewrite "^/(.*)/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /$1/index.php?subaction=showfull&year=$2&month=$3&day=$4&news_name=$5&seourl=$5 last;

        rewrite "^/(.*)/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /$1/index.php?newsid=$5&news_page=$3&cstart=$4&seourl=$6&seocat=$2 last;
        rewrite "^/(.*)/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /$1/index.php?newsid=$4&news_page=$3&seourl=$5&seocat=$2 last;
        rewrite "^/(.*)/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$3&newsid=$4&seourl=$5&seocat=$2 last;
        rewrite "^/(.*)/([^.]+)/([0-9]+)-(.*).html(/?)+$" /$1/index.php?newsid=$3&seourl=$4&seocat=$2 last;

        rewrite "^/(.*)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /$1/index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5 last;
        rewrite "^/(.*)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /$1/index.php?newsid=$3&news_page=$2&seourl=$4 last;
        rewrite "^/(.*)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4 last;
        rewrite "^/(.*)/([0-9]+)-(.*).html(/?)+$" /$1/index.php?newsid=$2&seourl=$3 last;

        # За день
        rewrite "^/(.*)/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /$1/index.php?year=$2&month=$3&day=$4 last;
        rewrite "^/(.*)/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /$1/index.php?year=$2&month=$3&day=$4&cstart=$5 last;

        # За весь месяц
        rewrite "^/(.*)/([0-9]{4})/([0-9]{2})(/?)+$" /$1/index.php?year=$2&month=$3 last;
        rewrite "^/(.*)/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /$1/index.php?year=$2&month=$3&cstart=$4 last;

        # Вывод за весь год
        rewrite "^/(.*)/([0-9]{4})(/?)+$" /$1/index.php?year=$2 last;
        rewrite "^/(.*)/([0-9]{4})/page/([0-9]+)(/?)+$" /$1/index.php?year=$2&cstart=$3 last;

        # вывод отдельному тегу
        rewrite "^/(.*)/tags/([^/]*)(/?)+$" /$1/index.php?do=tags&tag=$2 last;
        rewrite "^/(.*)/tags/([^/]*)/page/([0-9]+)(/?)+$" /$1/index.php?do=tags&tag=$2&cstart=$3 last;

        # поиск по доп полям
        rewrite "^/(.*)/xfsearch/(.*)/page/([0-9]+)(/?)+$" /$1/index.php?do=xfsearch&xf=$2&cstart=$3 last;
        rewrite "^/(.*)/xfsearch/(.*)(/?)+$" /$1/index.php?do=xfsearch&xf=$2 last;

        # вывод для отдельного юзера
        rewrite "^/(.*)/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$2 last;
        rewrite "^/(.*)/user/([^/]*)(/?)+$" /$1/index.php?subaction=userinfo&user=$2 last;
        rewrite "^/(.*)/user/([^/]*)/page/([0-9]+)(/?)+$" /$1/index.php?subaction=userinfo&user=$2&cstart=$3 last;
        rewrite "^/(.*)/user/([^/]*)/news(/?)+$" /$1/index.php?subaction=allnews&user=$2 last;
        rewrite "^/(.*)/user/([^/]*)/news/page/([0-9]+)(/?)+$" /$1/index.php?subaction=allnews&user=$2&cstart=$3 last;
        rewrite "^/(.*)/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$2 last;
    
        # вывод всех последних новостей
        rewrite "^/(.*)/lastnews(/?)+$" /$1/index.php?do=lastnews last;
        rewrite "^/(.*)/lastnews/page/([0-9]+)(/?)+$" /$1/index.php?do=lastnews&cstart=$2 last;

        # вывод в виде каталога
        rewrite "^/(.*)/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$2 last;
        rewrite "^/(.*)/catalog/([^/]*)(/?)+$" /$1/index.php?catalog=$2 last;
        rewrite "^/(.*)/catalog/([^/]*)/page/([0-9]+)(/?)+$" /$1/index.php?catalog=$2&cstart=$3 last;

        # вывод непрочитанных статей
        rewrite "^/(.*)/newposts(/?)+$" /$1/index.php?subaction=newposts last;
        rewrite "^/(.*)/newposts/page/([0-9]+)(/?)+$" /$1/index.php?subaction=newposts&cstart=$2 last;

        # вывод избранных статей
        rewrite "^/(.*)/favorites(/?)+$" /$1/index.php?do=favorites last;
        rewrite "^/(.*)/favorites/page/([0-9]+)(/?)+$" /$1/index.php?do=favorites&cstart=$2 last;

        rewrite "^/(.*)/rules.html$" /$1/index.php?do=rules last;
        rewrite "^/(.*)/statistics.html$" /$1/index.php?do=stats last;
        rewrite "^/(.*)/addnews.html$" /$1/index.php?do=addnews last;
        rewrite "^/(.*)/rss.xml$" /engine/rss.php last;
        rewrite "^/(.*)/sitemap.xml$" /uploads/sitemap.xml last;

        if (!-d $request_filename) {
            rewrite "^/(.*)/([^.]+)/page/([0-9]+)(/?)+$" /$1/index.php?do=cat&category=$2&cstart=$3 last;
            rewrite "^/(.*)/([^.]+)/?$" /$1/index.php?do=cat&category=$2 last;
        }

        if (!-f $request_filename) {
            rewrite "^/(.*)/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$2 last;
            rewrite "^/(.*)/page,([0-9]+),([^/]+).html$" /$1/index.php?do=static&page=$3&news_page=$2 last;
            rewrite "^/(.*)/print:([^/]+).html$" /engine/print.php?do=static&page=$2 last;
        }

        if (!-f $request_filename) {
            rewrite "^/(.*)/([^/]+).html$" /$1/index.php?do=static&page=$2 last;
        }
        
                
        location ~ \.php$ {
            index index.php;
            try_files $uri =404; 
            fastcgi_pass unix:/run/php-fpm/php-fpm.sock; 
            fastcgi_index index.php; 
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
            include fastcgi_params; 
        }
	}

Но не работает навигация в тегах, в чем проблема может-быть, в остальных местах навигация работает

Ссылка на сообщение
Поделиться на других сайтах

Попробуйте:
# вывод отдельному тегу
rewrite "^/(.*)/tags/([^/]*)/page/([0-9]+)(/?)+$" /$1/index.php?do=tags&tag=$2&cstart=$3 last;
rewrite "^/(.*)/tags/([^/]*)(/?)+$" /$1/index.php?do=tags&tag=$2 last;

Ссылка на сообщение
Поделиться на других сайтах

Присоединяйтесь к обсуждению

Вы можете опубликовать сообщение сейчас, а зарегистрироваться позже. Если у вас есть аккаунт, войдите в него для написания от своего имени.

Гость
Ответить в тему...

×   Вставлено в виде отформатированного текста.   Вставить в виде обычного текста

  Разрешено не более 75 эмодзи.

×   Ваша ссылка была автоматически встроена.   Отобразить как ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставить изображения напрямую. Загрузите или вставьте изображения по ссылке.

×
×
  • Создать...