Forum: NGINX Nginx 301 redirection problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Céd B. (Guest)
on 2009-05-06 12:27
(Received via mailing list)
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édric
http://cedricbousmanne.com/
This topic is locked and can not be replied to.