Home > linux, Webservice > nginx wordpress permalink

nginx wordpress permalink

April 29th, 2009

As you are aware nginx don’t read .htaccess rewrite rule nginx has its own rewrite rule. WordPress has already embraced nginx, wordpress.com works with nginx. There will be problems if you enable permalink option in wordpress nginx. Here is the workaround for it.

You can find permalink option at

Login as wordpress admin
Click on settings -> permalinks
Custom Structure /%postname%/   # This is the one I am using you can opt any other which is given as example in that page.

Now goto wp-content/plugin directory of your wordpress installation

 wget http://downloads.wordpress.org/plugin/nginx-compatibility.0.1.1.zip 

unzip it in the plugin directory
Now go to admin settings and activate this plugin. Permalink should be working now. Mind you if you have installed wordpress on a separate folder your
“location /” in nginx should look something like the below

   location / {
        root /home/user/public_html;      #replace user with actual username
        index index.html index.htm index.php;
if ($request_uri ~* ^.*/.*$) {
     rewrite ^/(w*)/(.*)$ /$1/index.php?q=$2 last;
     break;
}
}

A working example is this blog itself :)

VN:F [1.9.6_1107]
Rating: 5.8/10 (9 votes cast)
VN:F [1.9.6_1107]
Rating: -2 (from 2 votes)
nginx wordpress permalink, 5.8 out of 10 based on 9 ratings
Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Live
  • StumbleUpon
  • Twitter
  • Yahoo! Buzz
  • Reddit
  • Technorati

Shijil T S linux, Webservice

  1. November 10th, 2010 at 01:49 | #1

    Thats great, but nginx doesnt seem to be giving you the speed you might need. If I was you I would install memcached and start caching these pages. From that point on it will be BLAZING fast.

    Cheers,

    Wes

    VA:F [1.9.6_1107]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.6_1107]
    Rating: 0 (from 0 votes)
  1. October 27th, 2009 at 12:56 | #1
  2. October 27th, 2009 at 13:42 | #2
  3. September 29th, 2010 at 14:49 | #3

Spam Protection by WP-SpamFree