Nginx URL rewriting WordPress

I am running WordPress with nginx and the URL rules rewriting is over my head. I don’t understand why is it not working.

Should be:

Read More

https://www.impotencetointimacy.com

But redirects to:

https://www.impotencetointimacy.com/impotencetointimacy.com/faq/

I have removed the .htaccess file.

Here is my nginx config:

server {
listen       66.216.100.111:80;
server_name  impotencetointimacy.com www.impotencetointimacy.com;
root /home/mydir;
    error_log /home/mydir/error_log;

location / {
        index  index.php index.html index.htm;
# return 301 https://$host$request_uri;
}
    location ~ .php$ {
    root           /home/mydir;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  /home/mydir/$fastcgi_script_name;
    include        fastcgi_params;
}

if (!-e $request_filename)
{
    rewrite ^(.+)$ /index.php?q=$1 last;
}

#if (!-e $request_filename) {
#    rewrite ^.* /index.php break;
#}

}

Another config is for SSL vhost.

What is going wrong?

Related posts

Leave a Reply