Wordpress issue On HTTPS #1

Closed
Dinesh-Ramakrishnan opened this Issue Apr 28, 2012 · 3 comments

Comments

Projects
None yet
5 participants
@Dinesh-Ramakrishnan

I installed Wordpress App on my Gear as per the guidelines provided in this repo.
When I lauched the Admin page, I am not able to login, Later I changed the Login Form Post URL from http to https it worked.
I faced the same problem with Codeigniter and my solution is posted here.

https://openshift.redhat.com/community/forums/openshift/https-key-not-set-in-server-over-https-protocol

if ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ) || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'))
{
/// On HTTPS URL
}

Please check and update the code accordingly.

@devop-mmcgrath

This comment has been minimized.

Show comment
Hide comment
@devop-mmcgrath

devop-mmcgrath Apr 30, 2012

Contributor

We've been thinking about ways to better handle this. In the meantime the only workaround is to put some code near the top of your scripts (maybe in the config?) that detects the state of the X-Forwarded-Proto header (http or https) and then manually set $_SERVER['HTTPS'] to on.

I know this isn't a very good answer but at least it's something you can do besides waiting on us to come up with something more permanent :)

Contributor

devop-mmcgrath commented Apr 30, 2012

We've been thinking about ways to better handle this. In the meantime the only workaround is to put some code near the top of your scripts (maybe in the config?) that detects the state of the X-Forwarded-Proto header (http or https) and then manually set $_SERVER['HTTPS'] to on.

I know this isn't a very good answer but at least it's something you can do besides waiting on us to come up with something more permanent :)

@ramr

This comment has been minimized.

Show comment
Hide comment
@ramr

ramr May 25, 2012

Followed a link here from OpenShift.

Hmm, maybe doing something like: RequestHeader edit Destination ^http: https: early
in the :443 virtual host might work [needs mod_headers].

ramr commented May 25, 2012

Followed a link here from OpenShift.

Hmm, maybe doing something like: RequestHeader edit Destination ^http: https: early
in the :443 virtual host might work [needs mod_headers].

@luciddreamz

This comment has been minimized.

Show comment
Hide comment
@luciddreamz

luciddreamz Mar 24, 2015

Contributor

For reference, you can force HTTPS by updating your .htaccess file:

RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Or simply set 'FORCE_SSL_ADMIN' to false in the wp-config.php file:

define('FORCE_SSL_ADMIN', false);
Contributor

luciddreamz commented Mar 24, 2015

For reference, you can force HTTPS by updating your .htaccess file:

RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Or simply set 'FORCE_SSL_ADMIN' to false in the wp-config.php file:

define('FORCE_SSL_ADMIN', false);

@bparees bparees closed this Mar 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment