Make WordPress Core

Opened 5 years ago

Last modified 20 months ago

#16167 new defect (bug)

FORCE_ADMIN_SSL broken if site runs on port different from 80

Reported by: yoush Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.0.4
Component: Bootstrap/Load Keywords: has-patch
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 5 years ago.
Patch that fixes this issue for me
16167.patch (8.9 KB) - added by kurtpayne 4 years ago.
Allow WP_HTTP_PORT and WP_HTTPS_PORT config values

Download all attachments as: .zip

Change History (6)

@yoush5 years ago

Patch that fixes this issue for me

comment:1 @mdawaffe5 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 :)

comment:2 @joh6nn4 years ago

  • Keywords has-patch added; needs-patch removed

@kurtpayne4 years ago

Allow WP_HTTP_PORT and WP_HTTPS_PORT config values

comment:3 @kurtpayne4 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:


comment:4 @nacin20 months ago

  • Component changed from General to Bootstrap/Load
Note: See TracTickets for help on using tickets.