NGINX redirect to internal pages .php on /?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
11 views
Good evening comrades, day 3 I suffer.
Need to do a redirect of internal pages with site.ru/page.php/ site.ru/page/

tried different options, managed to do a redirect from .php / but when going to get a 404 error

in a similar htaccess redirect is done without problems.

nginx.conf:

server {
listen *****:80;
server_name site.ru www.site.ru;
error_log /var/log/httpd/domains/site.EN.error.log error;
location /index.html {
return 301 $scheme://$host;
}

location / {
proxy_pass http://*.*.*.*:8080;
location ~ * ^.+\\.(html|jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
root /home/admin/web/site.ru/public_html;
access_log /var/log/httpd/domains/site.EN.log combined;
access_log /var/log/httpd/domains/site.EN.bytes bytes;
expires max;
try_files $uri @fallback;
}
}

location /error/ {
alias /home/admin/web/site.EN/document_errors/;
}

location @fallback {
proxy_pass http://*.*.*.*:8080;
}

location ~ /\\.ht {return 404;}
location ~ /\\.svn/ {return 404;}
location ~ /\\.git/ {return 404;}
location ~ /\\.hg/ {return 404;}
location ~ /\\.bzr/ {return 404;}

"disable_symlinks" if_not_owner from=/home/admin/web/site.ru/public_html;

include /home/admin/conf/web/nginx.site.EN.conf*;
}

I would be grateful for any help
by | 11 views

1 Answer

0 like 0 dislike
if ($request_uri ~* "^(.*/)index\\.(html|php)$") { return 301 $1; }

If you honestly do not quite understand Your question, it is more similar to the complaint. Here is my version removes index.php and index.html at the root of the current folder. You asked it? If not, ask the question more correctly.
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
5 answers
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
35,534 users