1

我正在使用 nginx 运行 Wordpress,而 URL 规则重写已经超出了我的想象。我不明白为什么它不起作用。

应该:

https://www.impotencetointimacy.com

但重定向到:

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

我已经删除了 .htaccess 文件。

这是我的 nginx 配置:

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;
#}

}

另一个配置是用于 SSL 虚拟主机。

出了什么问题?

4

0 回答 0