rewrite rule for WordPress with Nginx to avoid non standart permalink error

0
652

nginx error…wait. do you ever compare nginx with another ones

People find unable to get permalink work in WordPress when using Nginx stack. It’s because Nginx rewrite rule for WordPress has been set up.

permalink

this instruction for webuzo cpanel

  • First Step is :

nano /usr/local/apps/nginx/etc/conf.d/webuzoVH.conf

Add:

if (!-e $request_filename)

rewrite ^(.+)$ /index.php?q=$1 last;

}

that code write in end of this code

include         /usr/local/apps/nginx/etc/conf.d/common;

  • Restart your Nginx with this code :

service nginx restart

  • Next Step is add the rewrite in 

/usr/local/apps/nginx/etc/conf.d/common

add the following to the file:

#For wordpress

if (!-e $request_filename)

{

    rewrite ^(.+)$ /index.php?q=$1 last;

}

  • last step restart again your nginx

remember different from apache. every change in nginx don`t forget to restart to make your change work.

service nginx restart

 

0/5 (0 Reviews)

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.