Php 在Wordpress应用程序上获得错误“你太多”重定向;“提交的uri太大”;
我正在使用一个Php 在Wordpress应用程序上获得错误“你太多”重定向;“提交的uri太大”;,php,wordpress,xampp,Php,Wordpress,Xampp,我正在使用一个wordpress应用程序,并在跨平台web服务器xampp上运行它。这个网站运行了好几个星期。突然,URL开始返回错误\u太多\u重定向。网站只是陷入了无限的重定向循环 在浏览器上打开URL将重定向到并继续在URL末尾添加重定向到=http%3A%2F%wordpress.example.com%2F,直到达到apacheGET限制。最后,Web服务器返回错误HTTP414“请求URI太长” 我检查了我的xampp(apache、mysql、php)的设置和配置;所有都未更改,表
wordpress
应用程序,并在跨平台web服务器xampp
上运行它。这个网站运行了好几个星期。突然,URL开始返回错误\u太多\u重定向
。网站只是陷入了无限的重定向循环
在浏览器上打开URL将重定向到并继续在URL末尾添加重定向到=http%3A%2F%wordpress.example.com%2F,直到达到apacheGET
限制。最后,Web服务器返回错误HTTP414“请求URI太长”
我检查了我的xampp(apache、mysql、php)的设置和配置;所有都未更改,表示默认设置
apache日志读取
"GET /?redirect_to=http%3A%2F%2Fwordpress.example.com%2F%3Fredirect_to%3Dhttp%253A%252F%252Fwordpress.example.com%252F HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"
我重新启动了Web服务器
已检查.htaccess
设置
<IfModule mod_rewrite.c>
RewriteEngine On
# RewriteBase /
# Force Domain & SSL
# RewriteCond %{SERVER_PORT} !^443 [OR]
# Security Fix, no names for you my friend
RewriteCond %{QUERY_STRING} author=\d
RewriteRule ^ /? [L,R=301]
# If the requested filename exists, simply serve it.
# We only want to let Apache serve files and not directories.
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .* - [L]
# Admin 404 Fix
RewriteRule ^wp/wp-admin/$ wp/wp-admin/index.php [L]
# Rewrite all other queries to the Wordpress.
RewriteRule .* wp/index.php [L] # Use if live env is up
# RewriteRule .* update.html [L] # Use if updating live env
</IfModule>
附加说明:我既没有使用任何SEO插件或任何重定向,也没有使用安全的https。
此外,GET没有表单。站点内的所有请求都在使用POST。如前所述,有五种方法/步骤可以消除错误的过多重定向
.htaccess
配置
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
这不是多站点的htaccess配置吗?
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]