Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 2 sites running on nginx (php wordpress).

For some reason redirects are working differently, although they both have the same vhost setup. redirects to stays at

domain2 seems to be acting strainge: stays at redirects to

What could be the issue?

both vhosts have this:


What I want is for both domains to redirect from to

share|improve this question
Will need your configuration file to tell, right now you're asking people to make random guesses. – Martin Fjordvald Jun 26 '10 at 2:12
We'll also need to know what code (if any) you've got running within those sites, as code can also generate redirects. – BMDan Jun 26 '10 at 3:54
Also post the output of wget --spider -qS http://{,www.}domain{1,2}.com/. – joschi Jun 26 '10 at 8:17

I suspect it's most likely that wordpress is configured differently and is handling the rewrites in one case.

You can configure nginx to always redirect with something like:

if ($host ~* ^domain\.com) {
     rewrite ^(.*)$$1 permanent;
share|improve this answer
it was wordpress after all, thanks a million! – Blankman Jul 1 '10 at 18:59

Your Answer


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.