On Sun, Dec 11, 2016 at 12:05:19PM -0500, Joergi wrote:
Hi there,
> location ~ \.php5 {
> root /home/$username/www/;
> rewrite ^/(.*)\.php5 /$1.php permanent;
> }
>
> The problem with this is that it rewrites the files, also if they are in
> subfolders - and this is what I do not want.
You don't say what you want to happen to those other files, so I will
leave it at "nothing special".
Just rewrite what you want to. That is: no-slash, or /wiki/ then no-slash.
rewrite ^/([^/]*)\.php5 /$1.php permanent;
rewrite ^(/wiki/[^/]*\.php)5 $1 permanent;
Untested, but it looks right :-)
You may want to restrict these to the locations that match their prefixes,
depending on what else is happening.
f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx