[wp-trac] [WordPress Trac] #40013: Inifinite loop in subfolder

WordPress Trac noreply at wordpress.org
Thu May 7 20:50:53 UTC 2020


#40013: Inifinite loop in subfolder
--------------------------+------------------------
 Reporter:  dSero         |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Canonical     |     Version:  4.7.2
 Severity:  normal        |  Resolution:  duplicate
 Keywords:                |     Focuses:
--------------------------+------------------------
Changes (by SergeyBiryukov):

 * keywords:  2nd-opinion =>
 * status:  new => closed
 * resolution:   => duplicate
 * milestone:  Awaiting Review =>


Comment:

 Hi there, welcome to WordPress Trac! Sorry it took so long for someone to
 get back to you.

 Replying to [comment:2 markparnell]:
 > on the surface the existing code looks correct to me, but someone who is
 familiar with the code is going to need to take a look.

 The existing logic is indeed correct.

 If `redirect_canonical( $redirect_url, false )` returns void, that means
 there won't be an infinite loop, and it's safe to proceed with the
 redirect.

 If `redirect_canonical( $redirect_url, false )` returns a string, and
 we're proceeding with the redirect as the ticket suggests, that means
 we're creating an infinite loop.

 This appears to be a duplicate of #15733, #31288, #38273, and some other
 tickets.

 The long and short of it is that the redirect loop is caused by the
 `is_ssl()` function, most likely due to `$_SERVER['HTTPS']` value not
 mapped to `$_SERVER['HTTP_X_FORWARDED_PROTO']` in your environment. This
 is a server-level configuration issue with reverse proxy web servers. You
 just need to add something along the lines of the following to your `wp-
 config.php` file:
 {{{
 $_SERVER['HTTPS'] = 1;
 }}}
 Any proxy configuration is "supported" by WordPress, you just need to
 remap the `$_SERVER['HTTPS']` server variable based the particular proxy
 configuration you're using.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/40013#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list