Make WordPress Core

Opened 6 years ago

Last modified 10 months ago

#16167 reviewing defect (bug)

FORCE_ADMIN_SSL broken if site runs on port different from 80

Reported by: yoush Owned by: johnbillion
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 2.6
Component: Bootstrap/Load Keywords: has-patch, needs-unit-tests, needs-testing, needs-refresh, https
Focuses: Cc:


I'm running a wordpress site (http://yoush.homelinux.org:8079/) hosted at my home server. Unfortunately mu ISP blocks incoming connections on port 80, so I have to use non-standard port.

With unmodified wordpress 3.0.4, I was unable to use FORCE_ADMIN_SSL, because it caused URLs starting with


to be converted to


Which is definitly broken since it is impossible to serve both http and https on the same port.

To fix this, I propose removing ':port' from URL when converting http url to https.
I've created a patch for this, that seems to work for me on my site.

Attachments (2)

When-converting-http-url-to-https-url-remove-port.patch (5.0 KB) - added by yoush 6 years ago.
Patch that fixes this issue for me
16167.patch (8.9 KB) - added by kurtpayne 5 years ago.
Allow WP_HTTP_PORT and WP_HTTPS_PORT config values

Download all attachments as: .zip

Change History (10)

6 years ago

Patch that fixes this issue for me

#1 @mdawaffe
6 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Another idea would be to create two new constants WP_PORT_HTTP and WP_PORT_HTTPS or something and append them to the domain during that redirect (if they're not 80, 443 respectively).

Speaking as a former I-host-my-blog-on-a-non-standard-port WordPress user myself, I can sympathize :)

#2 @joh6nn
5 years ago

  • Keywords has-patch added; needs-patch removed

5 years ago

Allow WP_HTTP_PORT and WP_HTTPS_PORT config values

#3 @kurtpayne
5 years ago

  • Cc kpayne@… added

To use this 16167.patch, create new constants in your wp-config.php file like so:

define('WP_HTTP_PORT', 81);
define('WP_HTTPS_PORT', 444);

Then you should be able to login / admin on over SSL on port 444, but browse content over port 81. There's two new functions for themes / plugins, too, to convert between URLs between http / https:


#4 @nacin
3 years ago

  • Component changed from General to Bootstrap/Load

#5 @chriscct7
12 months ago

  • Keywords needs-refresh added

Also has some formatting issues

#6 @johnbillion
12 months ago

  • Keywords needs-unit-tests needs-testing added; needs-refresh removed
  • Milestone changed from Future Release to Awaiting Review
  • Owner set to johnbillion
  • Status changed from new to reviewing
  • Version changed from 3.0.4 to 2.6

#7 @johnbillion
12 months ago

  • Keywords needs-refresh added

#8 @johnbillion
10 months ago

  • Keywords https added
Note: See TracTickets for help on using tickets.