[wp-trac] [WordPress Trac] #9102: Inverse proxy breaks permalinks

WordPress Trac wp-trac at lists.automattic.com
Thu Feb 12 01:58:37 GMT 2009


#9102: Inverse proxy breaks permalinks
-----------------------------+----------------------------------------------
 Reporter:  Bernhard Reiter  |       Owner:  ryan                      
     Type:  defect (bug)     |      Status:  new                       
 Priority:  normal           |   Milestone:  2.8                       
Component:  Permalinks       |     Version:  2.7                       
 Severity:  normal           |    Keywords:  inverse, proxy, permalinks
-----------------------------+----------------------------------------------
 I have a WP installation at my university's webspace (on an apache
 server), say http://myuni.ac.at/mydir/wordpress/ , and an inverse proxy
 domain http://mydomain.at/ for it.
 This means that any request to the latter, eg for
 http://mydomain.at/2009/02/12/inverse-proxy-trouble/ , is forwarded to
 http://myuni.ac.at/mydir/wordpress/ , which in turn means that the
 REQUEST_URI there becomes /mydir/wordpress/2009/02/inverse-proxy-trouble/
 . My ''home'' variable is of course set to http://mydomain.at/
 (''siteurl'' is set to http://myuni.ac.at/mydir/wordpress/ -- otherwise I
 wouldn't be able to login to WP).

 Unfortunately, when analyzing REQUEST_URI, wordpress chops off the
 ''home'' path, not the ''siteurl'' one. This may be okay for some
 purposes, but in the inverse proxy case, permalinks break. For a fix, I
 had to hack two wordpress core files, namely

 wp-includes/classes.php
 in function parse_request: change line 162 from

 {{{
 $home_path = parse_url(get_option('home'));
 }}}
 to
 {{{
 $home_path = parse_url(get_option('siteurl'));
 }}}

 and wp-includes/rewrite.php, in function get_pagenum_link, line 987, same
 modification.

 This is a dirty hack, of course; so I wonder if in general, using the
 ''siteurl'' path is valid in any case where the ''home'' host differs from
 the ''siteurl'' host. If so, I suggest changing the affected files in such
 a manner.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9102>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list