can not make WordPress pretty permalinks work

Edho Arief edho at myconan.net
Wed May 9 13:54:49 UTC 2012


On Wed, May 9, 2012 at 8:51 PM, seron <nginx-forum at nginx.us> wrote:
> I made a fresh install of WordPress in a new directory and made a
> separate server section in nginx.conf for it.
>
> I tired what you suggested, but to no avail. There's a small change
> which is that I don't get a 404 error any more and the page is
> displayed. My guess is that it's a different problem present in my
> original WordPress installation which is not present in the new one.
>
> The problem with the pretty permalinks still remains however.
>
> For example the WordPress sample page can have either of these two
> permalinks, depending on if permalinks are set to default or something
> else:
>
> http://wptest.dev/?page_id=2 (default permalink setting)
> http://wptest.dev/index.php/sample-page/ (any other permalink setting)
>

Remove the /index.php part unless you really love it (I don't) - which
then this additional config is needed:

  location /index.php/ {
    rewrite ^/index.php/(.+)$ /index.php?q=$1&$args;
  }

Make sure to put it before "location /" block.



More information about the nginx mailing list