Welcome! Log In Create A New Profile

Advanced

Re: How do I rewrite files, but only, if they are in one special folder?

Francis Daly
December 29, 2016 05:48AM
On Tue, Dec 13, 2016 at 01:29:17PM -0500, Joergi wrote:

Hi there,

> > rewrite ^/([^/]*)\.php5 /$1.php permanent;
> > rewrite ^(/wiki/[^/]*\.php)5 $1 permanent;

> > You may want to restrict these to the locations that match their
> > prefixes, depending on what else is happening.
>
> What do you mean? The "main folder", which you are influencing with your
> first rule, is the web root: /home/$username/www/. The foder wiki is the
> subfolder in there. Any recommendation what location I should add around the
> two rewrites or if I should add one?

Depending on what else is in your config, it may be useful to put the
second rewrite within a "location ^~ /wiki/ {}" block.

But if you don't measure a difference when putting it there, in a
"location ~ \.php5 {}" block, or at server{] level, then it does not
matter in your deployment.

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How do I rewrite files, but only, if they are in one special folder?

Joergi December 11, 2016 12:05PM

Re: How do I rewrite files, but only, if they are in one special folder?

Francis Daly December 12, 2016 04:20PM

Re: How do I rewrite files, but only, if they are in one special folder?

Joergi December 13, 2016 01:29PM

Re: How do I rewrite files, but only, if they are in one special folder?

Francis Daly December 29, 2016 05:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 248
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready