ЧПУ

ЧПУ 1.2.0

Нет прав для скачивания

Protektor

Пользователь
Exile, ну да. При тех реврайтах что идут с модом, если мод выключить то страница получается доступна по двум адресам (стандартный и чпу) а я хотел что бы при переходе по чпу (из выдачи поисковика к примеру) адрес
topic-tove-jansson-tuve-yansson-vse-o-mumi-trollyah-povesti-skazki-2003-djvu-rus-t=91494.html
на
viewtopic.php?t=91494
редиректило.
 

Protektor

Пользователь
Exile, да это я ерунду написал там ))) обратный конечно, вот я тип постоянно ищу сам себе головняки а ответ на поверхности лежит!!!

location /topic {
rewrite ^/topic-(.*)-(.*).html /viewtopic.php?$2 permanent;
}
 

vladF

Пользователь
Поставил, проверил, вроде все верно. Создал новый форум и переходе по ссылки - "Not Found". А так ЧПУ работает. в чем может быть проблема?
 
Последнее редактирование:

Kryl

Пользователь
Что не могу разобраться с

location /profile {
rewrite ^/profile-(.*)-(.*).html /profile.php?$2 last;
}

обработка файла не происходит, он тупо скачивается. Куда копать то ???
server {
listen 10.0.2.15:80;
server_name torrent33.net

Please Login or Register to view hidden text.


root /home/admin/web/torrent33.net/public_html;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/torrent33.net.log combined;
access_log /var/log/nginx/domains/torrent33.net.bytes bytes;
error_log /var/log/nginx/domains/torrent33.net.error.log error;


location / {

location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires 30d;
}

location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}

fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}


error_page 403 /error/404.html;
error_page 404 /error/404.html;
error_page 500 502 503 504 /error/50x.html;

location /error/ {
alias /home/admin/web/torrent33.net/document_errors/;
}

location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}

location = /sitemap.xml {
rewrite ^/sitemap.xml$ /internal_data/sitemap/sitemap.xml;
}

location /internal_data {
rewrite ^/internal_data/atom/(.*) /atom$1 break;
}

location /category {
rewrite ^/category-(.*)-(.*).html /index.php?$2 last;
}

location /forum {
rewrite ^/forum-(.*)-(.*).html /viewforum.php?$2 last;
}

location /topic {
rewrite ^/topic-(.*)-(.*).html /viewtopic.php?$2 last;
}

location /profile {
rewrite ^/profile-(.*)-(.*).html /profile.php?$2 last;
}

location ~ \.(.*sql|tpl|db|inc|log|md)|(config|common).php$ {
deny all;
}


include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include /etc/nginx/conf.d/webmail.inc*;

#include /home/admin/conf/web/nginx.torrent33.net.conf*;
}
с профилем проблемы , что то не пойму с реврайтами , какой порядок должен быть ?
 

Protektor

Пользователь
Kryl l у меня когда он был установлен location с реврайтами шли сразу после секции location ~ \.php$
category
forum
topic
profile

если решил ставить этот мод, то лучше ни ставь , наживешь только геморой , его допиливать нужно.
 

Kryl

Пользователь
да он у меня стоит уже давно , просто сервак сегодня настроил на nginx php frm , и теперь профиль скачивается )
 

Kryl

Пользователь
location @php {
fastcgi_index index.php;
fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f [email protected]";
fastcgi_pass unix:/var/www/php-fpm/kryl.sock;
fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
try_files $uri =404;
include fastcgi_params;
}
location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}

location = /sitemap.xml {
rewrite ^/sitemap.xml$ /internal_data/sitemap/sitemap.xml;
}

location /internal_data {
rewrite ^/internal_data/atom/(.*) /atom$1 break;
}

location /category {
rewrite ^/category-(.*)-(.*).html /index.php?$2 last;
}

location /forum {
rewrite ^/forum-(.*)-(.*).html /viewforum.php?$2 last;
}

location /topic {
rewrite ^/topic-(.*)-(.*).html /viewtopic.php?$2 last;
}

location /profile {
rewrite ^/profile-(.*)-(.*).html /profile.php?$2 last;
}

location ~ \.(.*sql|tpl|db|inc|log|md)|(config|common).php$ {
deny all;
}
 
Сверху