Odd redirect issue with Wordpress even though Headers are correct when missing trailing slash Odd redirect issue with Wordpress even though Headers are correct when missing trailing slash wordpress wordpress

Odd redirect issue with Wordpress even though Headers are correct when missing trailing slash


# Force Trailing Slash - Beau Bhavik Code START<IfModule rewrite_module>  RewriteEngine On  RewriteBase /  # If not a real file or directory.  RewriteCond %{REQUEST_FILENAME} !-f  RewriteCond %{REQUEST_FILENAME} !-d  # Not a part of the WP admin area.  RewriteCond %{REQUEST_URI} !(?:^|/)wp\-admin(?:/|$)  # If there is no trailing slash.  RewriteCond %{REQUEST_URI} !(?:.*)/$  # Force a trailing slash on all virtual requests.  RewriteRule ^(.*)$ /$1/ [QSA,L,R=301]</IfModule># Force Trailing Slash - Beau Bhavik Code END# Force NO Trailing Slash - Beau Bhavik Code START<IfModule rewrite_module>  RewriteEngine On  RewriteBase /  # If not a real file or directory.  RewriteCond %{REQUEST_FILENAME} !-f  RewriteCond %{REQUEST_FILENAME} !-d  # Not a part of the WP admin area.  RewriteCond %{REQUEST_URI} !(?:^|/)wp\-admin(?:/|$)  # If there is a trailing slash.  RewriteCond %{REQUEST_URI} (?:.*)/$  # Force NO trailing slash on all virtual requests.  RewriteRule ^(.*)/$ /$1 [QSA,L,R=301]</IfModule># Force NO Trailing Slash - Beau Bhavik Code END


I would check that you haven't got any conflicting rules with your server (such as .htaccess or nginx rules) where basically one is trying to correct the other and thus the infinite loop.

I'd also make sure your rewrite rules are OK - have you done anything funky with permalinks? Quick way to debug would be turn off permalinks or change the rule to a different one. May give some clues