[wp-hackers] Interesting Permalink Issue

Otto otto at ottodestruct.com
Wed Aug 22 18:33:32 UTC 2012


On Wed, Aug 22, 2012 at 12:05 PM, Jeffrey Nolte <jnolte at getmoxied.net> wrote:
> Something I forgot to note is that we are using NGINX for server.  I will look into the equivalent of these settings in NGINX.

On nginx, I always add this line of code somewhere (usually in a
plugin) to force the rewrites to not include the index.php file:

add_filter( 'got_rewrite', '__return_true' );

Next, because WordPress doesn't create nginx config files natively,
you'll need to do it yourself. These rules in the .conf file will do
the job:

if (!-e $request_filename) {
  rewrite ^/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;
  rewrite ^.*$ /index.php last;
}

You can leave off the ms-files one if you're not using a multi-site install.

-Otto


More information about the wp-hackers mailing list