Stanislav Kuhlevskiy
Stanislav Kuhlevskiy

Reputation: 99

How to minimize redirects single url in nginx?

How to minimize such requests in one?

location = /GetFile.ashx {
    return 301 /overview-videos/;
}
location = /products/GetFile.ashx {
    return 301 /overview-videos/;
}
location = /abouts/GetFile.ashx {
    return 301 /overview-videos/;
}

Upvotes: 0

Views: 250

Answers (1)

Stanislav Kuhlevskiy
Stanislav Kuhlevskiy

Reputation: 99

A simple solution for the Nginx:

location ~ ^/(.*)GetFile.ashx$ {
     return 301 /overview-videos/;
}

Upvotes: 1

Related Questions