[wp-trac] [WordPress Trac] #36201: Admin Pagination URLs Use Wrong Hostname

WordPress Trac noreply at wordpress.org
Thu Apr 18 01:41:41 UTC 2019


#36201: Admin Pagination URLs Use Wrong Hostname
-------------------------------------------------+-------------------------
 Reporter:  grimmdude                            |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Administration                       |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing dev-         |     Focuses:
  feedback close                                 |
-------------------------------------------------+-------------------------

Comment (by wellmadedigital):

 We had this same issue and stumbled on this:

 "The site’s wp-config.php file needs to be updated with a
 $_SERVER['HTTP_HOST'] definition pointing at the main site URL
 (example.com in the example we’ve been considering)." Source:
 https://kinsta.com/knowledgebase/reverse-proxy/

 Adding `$_SERVER['HTTP_HOST'] = 'yoursite.com';` to our ProxyPass settings
 in wp-config resolved it.

 As an example:

 Site exists at subdomain.yoursite.com. Proxied to
 www.yoursite.com/subdomain

 Added to wp-config to make this work and resolve the Wordpress Admin URL
 issues (pagination, editing users, etc.):

 {{{#!php
 <?php
 # ProxyPass Settings
 #
 # DO NOT REMOVE: overriding the following variables is
 # required to ensure that any request /journal/* is handled
 $_SERVER['REQUEST_URI'] = '/subdomain' . $_SERVER['REQUEST_URI'];
 $_SERVER['SCRIPT_NAME'] = '/subdomain' . $_SERVER['SCRIPT_NAME'];
 $_SERVER['PHP_SELF'] = '/subdomain' . $_SERVER['PHP_SELF'];
 $_SERVER['HTTP_HOST'] = 'www.yoursite.com';
 }}}

 I still agree with the OP that this feels like a core bug, but I wanted to
 throw this out there as an alternative solution that doesn't require core
 revision.

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


More information about the wp-trac mailing list