I am a complete newbie to Nginx, a lot to ensure that I adopted a online help guide to do the majority of my server setup. I am learning but I am still a ways from understanding everything.

What exactly I am attempting to create is really a link shortener that redirects (example.com/x) to (example.com/short.php?id=x). Bear in mind that I am also managing a Wordpress blog on a single domain and intend on while using redirects/shortening for exterior links. The guide has to date had me add the next rewrites make it possible for Wordpress pretty Web addresses:

  # WordPress pretty URLs: (as per dominiek.com)
  if (-f $request_filename) {
  break;
  }
  if (-d $request_filename) {
  break;
  }
  rewrite ^(.+)$ /index.php?q=$1 last;


  # Enable nice permalinks for WordPress: (as per Yawn.it)
  error_page  404  = //index.php?q=$uri;

And when it matters any, it had been saved at (/usr/local/nginx/conf/wordpress_params.regular).

Furthermore, my Wordpress link structure adds "news" to any or all internal links (example.com/news/publish-blah, example.com/news/category, ect.). What's the easiest method to tackle this setup?

ok, I finally determined using regular expression to rewrite wordpress permalink in nginx.