Redirect only home page

Harikrishnan asked:

I need to redirect only http://shop.test.com to http://www.test.com/fedex-orders/

Just homepage. Nothing else. ie http://shop.test.com/?page=blog should NOT redirect.

My answer:


location = / {
    return 301 http://www.test.com/fedex-orders/;
}

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.