1

I am changing my site address and I am having difficulty in two types of 301 redirects on the server Nginx. I've tried MANY ways to do this, but everything went wrong so far.

I want to change the:

^/downs/pafiledb.php?action=download&id=(NUMBER)

to other site:

http://www.newsite.com/downloads/NUMBER

And also a problem with the redirect with the pictures, see below.

I want to change the entire folder to another site:

^/images/

to

http://www.newsite.com/images/

How can I do this? I've tried every way possible in Nginx and nothing works.

4

1 回答 1

2
location = /downs/pafiledb.php {
    if ($arg_action = download) {
        return 301 http://www.newsite.com/downloads/$arg_id;
    }
}

location /images/ {
    return 301 http://www.newsite.com$request_uri;
}
于 2012-07-23T02:16:52.617 回答