Make WordPress Core

Opened 17 years ago

Closed 2 weeks ago

Last modified 2 weeks ago

#9102 closed defect (bug) (invalid)

Inverse proxy breaks permalinks

Reported by: bernhard-reiter's profile Bernhard Reiter Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7
Component: Permalinks Keywords: has-patch needs-unit-tests early needs-refresh
Focuses: Cc:

Description

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.

Attachments (1)

9102.diff (2.4 KB) - added by Denis-de-Bernardy 17 years ago.

Download all attachments as: .zip

Change History (12)

#1 @Bernhard Reiter
17 years ago

  • Cc Bernhard Reiter added

#2 @Denis-de-Bernardy
17 years ago

  • Keywords has-patch needs-testing added; inverse proxy permalinks removed

please be so kind to give the attached patch a try

#3 @Denis-de-Bernardy
17 years ago

  • Keywords 2nd-opinion added

this might be a bit too big a change for a nearby release.

#4 @Denis-de-Bernardy
17 years ago

  • Keywords early added; 2nd-opinion removed
  • Milestone changed from 2.8 to 2.9

no tests in 2 weeks, punting to 2.9

#5 @ryan
16 years ago

  • Milestone changed from 2.9 to 3.0

#6 @dd32
16 years ago

  • Milestone changed from 3.0 to Future Release

Punting to Future Release due to no traction.

#7 @ryan
12 years ago

  • Owner ryan deleted
  • Status changed from new to assigned

#8 @chriscct7
10 years ago

  • Keywords needs-unit-tests needs-refresh added

Still needs unit tests and a refresh

#9 @SirLouen
3 weeks ago

  • Keywords needs-testing removed

Considering that it needs a refresh according to @chriscct7 and no changes have occurred since then, I'm removing the Needs Testing tag, as there is nothing to test here.

#10 follow-up: @johnbillion
2 weeks ago

  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from assigned to closed

This has had basically no movement in 17 years. I'm making an executive decision to close it. Thanks everyone.

#11 in reply to: ↑ 10 @SirLouen
2 weeks ago

Replying to johnbillion:

This has had basically no movement in 17 years. I'm making an executive decision to close it. Thanks everyone.

You have closed Bernhard first ticket. That is the real executivity.

Last edited 2 weeks ago by SirLouen (previous) (diff)
Note: See TracTickets for help on using tickets.