简体   繁体   中英

Getting err_too_many_redirects on Wordpress application “Submitted uri too large”

I am using a wordpress application and running this on cross-platform web server xampp . The site was running well for few weeks. Suddenly the URL started returning err_too_many_redirects . The website just get stuck with an infinite redirection loop.

Opening the URL http://wordpress.example.com on the browser is redirecting to http://wordpress.example.com/login?redirect_to=http%3A%2F%wordpress.example.com%2F and keep on adding the redirect_to=http%3A%2F%wordpress.example.com%2F at the end of the URL, until it reaches the apache GET limit. At last, the webserver returns the error HTTP 414 “Request URI too long”

I checked the settings and configuration of my xampp (apache, mysql, php); all are unchanged meaning default setting.

The apache log reads

"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"

I restarted the webserver

Checked the .htaccess settings

<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>

The wp-config.php

define('WP_HOME','http://wordpress.example.com');
define('WP_SITEURL','http://wordpress.example.com/wp');

Additional note: I'm Neither using any SEO plugin or any redirection, nor using the secured https. Also, there is no form with the GET. All requests within site are using POST.

As hostinger explains there are five ways/steps to get rid of err_too_many_redirects

  1. Deleting Browser Data
  2. Checking Your URL Settings
  3. Deleting WordPress Cache
  4. Disabling Corrupted Plugins
  5. Disabling .htaccess File

It reads you are using the subdomain, you may like to have below subdomain specific .htaccess configuration

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]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM