Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to append a string to every request that refers to the root.

eg) www.a.com -> www.a.com/life/

I wrote the conf as below, but the brower said there are cyclic redirections:

            if ($host ~ 'www.a.com$') {
                    rewrite ^/(.*)$ http://www.a.com/life/ permanent;
            }

How to write this?

share|improve this question
add comment

1 Answer 1

You need to do this

 if ($host ~ 'www.a.com$') {
                    rewrite ^/$ http://www.a.com/life/ permanent;
            }
share|improve this answer
    
I think location = / {} is better. –  SaveTheRbtz Jan 13 '12 at 21:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.