Welcome! Log In Create A New Profile

Advanced

Redirecting folder to root with rewrite

Posted by NginxUser25 
Redirecting folder to root with rewrite
April 03, 2014 04:26PM
I'm new to Nginx and try to redirect a directory for jpg-files to the root directory. For example the file /abc/jpg.jpg should be opened directly through /jpg.jpg.

rewrite /(.*(jpg|jpeg))$ /directory/$1 last;

This works, but so all jpg files in other directories can't be opened any more. Many greetings
Re: Redirecting folder to root with rewrite
April 09, 2014 06:29AM
I have found a solution for the problem, now I use a second rewrite rule for other folders with jpg-files. Many Greetings



Edited 4 time(s). Last edit at 04/09/2014 06:38AM by NginxUser25.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 206
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready