Nginx 301 redirection problem

Hi all,

I’m new on this list and (nearly) newbie with Nginx, so, please, be
patient with my poor brain :wink:

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/
and so one.

My Nginx conf file :

server {

location /wordpress {
rewrite ^/wordpress//?(.(…)?)$$1

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

Can anyone help me?

Thanks per advance.

Bousmanne Cédric

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs