Earthtracker's Blog

Just another WordPress.com weblog

Server port or HTTPS on/off not detecting in htaccess

I tried to apply force HTTPS redirection on a server, it never worked and reidrecited multiple times. Here are codes i tried:


RewriteCond %{HTTPS} !on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
OR
RewriteCond %{ENV:HTTPS} !on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
OR
RewriteCond %{ENV:HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
OR
RewriteCond %{SERVER_PORT} 80
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Finally worked with :
# If we receive a forwarded http request from a proxy...
RewriteCond %{HTTP:X-Forwarded-Proto} =http [OR]
# ...or just a plain old http request directly from the client
RewriteCond %{HTTP:X-Forwarded-Proto} =""
RewriteCond %{HTTPS} !=on
# Redirect to https version
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Leave a comment »

Bug on upgrade from EE2 to EE3

After upgrade from EE2 to EE3, it seems some member fields are missing on exp_member_data table, which are required for EE3, but those were not generated by default on upgrade procedures, which is a major bug.

Error notice :


Undefined index: m_field_ft_11
ee/legacy/libraries/channel_entries_parser/components/Custom_member_field.php, line 120

You may fix this by adding those fields on exp_member_data table.
But Upgrade procedures should add those columns on EE3 upgrade procedures.

Leave a comment »