访问 wp-admin 时 WordPress 重定向错误
WordPress wrong redirect while accessing wp-admin
我有个小问题。
现在,我正在将我的 WordPress 站点从 Apache2 迁移到 Nginx。
一切正常,但管理面板不行。
当我尝试访问“/wp-admin”时,出现以下重定向:
http://domain.com/wp-login.php?redirect_to=http%3A%2F%2Fdomain.com%2Fwp-admin%2F&reauth=1
之后出现一个空白页面,没有其他任何内容。
我已经检查了 PHP 配置,示例 test.php 正在打印一些东西,所以它可以工作。
我做错了什么?
这是我的 Nginx 配置:
server
{
listen 155.123.12.222:80;
server_name domain.com www.domain.com ;
access_log /var/log/nginx/domains/domain.com.log;
access_log /var/log/nginx/domains/domain.com.bytes bytes;
error_log /var/log/nginx/domains/domain.com.error.log;
root /home/admin/domains/domain.com/public_html;
index index.php index.html index.htm;
location / {
index index.php;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location /wp-admin {
index index.php index.html index.htm;
try_files $uri /wp-admin/index.php?q=$uri&$args;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 24h;
log_not_found off;
}
location ~ /\. { access_log off; log_not_found off; deny all; }
location ~ \.php$
{
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/nginx_limits.conf;
if (-f $request_filename)
{
fastcgi_pass unix:/usr/local/php56/sockets/admin.sock;
}
}
location ~ /\.ht
{
deny all;
}
include /etc/nginx/webapps.conf;
}
尝试删除以下行:
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location /wp-admin {
index index.php index.html index.htm;
try_files $uri /wp-admin/index.php?q=$uri&$args;
}
好的,我找到了解决办法。
我在 wp-config.php 中开启了 DEUB 模式。某个插件的配置有问题,所以我改了。
无论如何,谢谢大家的关注。
我有个小问题。 现在,我正在将我的 WordPress 站点从 Apache2 迁移到 Nginx。 一切正常,但管理面板不行。
当我尝试访问“/wp-admin”时,出现以下重定向:
http://domain.com/wp-login.php?redirect_to=http%3A%2F%2Fdomain.com%2Fwp-admin%2F&reauth=1
之后出现一个空白页面,没有其他任何内容。 我已经检查了 PHP 配置,示例 test.php 正在打印一些东西,所以它可以工作。 我做错了什么?
这是我的 Nginx 配置:
server
{
listen 155.123.12.222:80;
server_name domain.com www.domain.com ;
access_log /var/log/nginx/domains/domain.com.log;
access_log /var/log/nginx/domains/domain.com.bytes bytes;
error_log /var/log/nginx/domains/domain.com.error.log;
root /home/admin/domains/domain.com/public_html;
index index.php index.html index.htm;
location / {
index index.php;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location /wp-admin {
index index.php index.html index.htm;
try_files $uri /wp-admin/index.php?q=$uri&$args;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 24h;
log_not_found off;
}
location ~ /\. { access_log off; log_not_found off; deny all; }
location ~ \.php$
{
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/nginx_limits.conf;
if (-f $request_filename)
{
fastcgi_pass unix:/usr/local/php56/sockets/admin.sock;
}
}
location ~ /\.ht
{
deny all;
}
include /etc/nginx/webapps.conf;
}
尝试删除以下行:
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location /wp-admin {
index index.php index.html index.htm;
try_files $uri /wp-admin/index.php?q=$uri&$args;
}
好的,我找到了解决办法。 我在 wp-config.php 中开启了 DEUB 模式。某个插件的配置有问题,所以我改了。
无论如何,谢谢大家的关注。