nginx + wordpress rewrite question

Cliff Wells cliff at
Tue Feb 9 03:16:08 MSK 2010

On Mon, 2010-02-08 at 19:09 -0500, Jaime Magiera wrote:
> Hello,
> This is a really basic question. I'm unfamiliar with nginx (didn't
> even know it existed until a couple days ago) and not a master at URL
> rewrites. I have been tasked with hooking up Wordpress to nginx. The
> basic setup was easy enough. However, I'm running into some problems
> with the rewrites. I've been asked to rewrite from the static
> permalink format...
> "/blog/$postname$-$post_id$"   (e.g. /blog/my_blog_post_title-49) =>
> to the standard "/blog/?p=N"
> I've tried a bunch of variations, but I keep getting it wrong because
> the non-post content (css, images, etc.) are returning 404s. Does
> anyone have an example of how to do a nginx rewrite that does the
> above?

You should probably setup a separate location for the static content
(images, css, etc), that way your rewrite doesn't affect them.


More information about the nginx mailing list