Welcome! Log In Create A New Profile

Advanced

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

December 13, 2016 01:29PM
Hi Francis,

thanks for your answer!

> You don't say what you want to happen to those other files, so I will
> leave it at "nothing special".

Yes, that is right. Files in other folders, also if the names of the files end on php5, should not be rewritten.

> That is: no-slash, or /wiki/ then no-slash.
>
> rewrite ^/([^/]*)\.php5 /$1.php permanent;
> rewrite ^(/wiki/[^/]*\.php)5 $1 permanent;

I am currently on the way understanding what you are doing here. Pretty sophisticated and way shorter than what I would have tried. In my tests this is working as expected. Thanks for the input! :-)

> 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?

Cheers!

Joerg
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: 319
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