Welcome! Log In Create A New Profile

Advanced

Nginx 301 redirection problem

Bousmanne Cédric
May 06, 2009 04:14AM
Hi all,

I'm new on this list and (nearly) newbie with Nginx, so, please, be
patient with my poor brain ;-)

Here's the problem i got : on my blog, i've got some reference on old
directories . I tried a rewrite rule to redirect these old links to
the correct directory.

Some possible case :

(url)/wordpress => (url)
(url)/wordpress/public/path/to/image/image.jpg => (url)/public/path/
to/image/image.jpg
and so one.

My Nginx conf file :

server {
# ...
location /wordpress {
rewrite ^/wordpress//?(.*(\..*)?)$ http://www.parenthese.be/$1
break;
}
}

At this time, i can redirect /wordpress to my domain, /wordpress/
something to /something, but i can't redirect when i try to get a
file. IE : /wordpress/something/image.jpg won't redirect my request at
all.

Can anyone help me?

Thanks per advance.


Bousmanne C
Subject Author Posted

Nginx 301 redirection problem

Bousmanne Cédric May 06, 2009 04:14AM



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