Hi Max
thank you for your quick response – i restored from backup and thought i should test a bit more before writing. What i found out now is that your plugin works perfectly (congrats! *****very cool! ?? but is kind of tricked out by my .htaccess and wp-config.php configuration, which i set up to forward admin and login tasks through my hosts SSL proxy (found at https://is.gd/165fHu, german). Requests are handled differently, and it is possible to be logged in with or without SSL protection. As it is the SSL proxy of the host, cookies are set in different places – at the SSL proxy or at my own wordpress install.
Today i reinstalled Media Vault, .htaccess permissions set to 666 to enable Media Vault to put its code, which brought up another problem – it also removed changes i had made to the standard WordPress code.
After uploading and linking images to galleries i checked PHPMyAdmin – images URLs (guid) are no SSL URLs, but in ‘dsframework-gallery’ data, which i suppose is the data for my themes (touchfolio) galleries template, URLs include the SSL part.
I am not sure what really happens, and for some time i didn’t see the problem occur, as both cookies with/withoutSSL wre set and most browsers accept mixed environments. When i am logged in in a pure no SSL environment images are not shown. My solution for the moment is to redirect all traffic to SSL, works fine but is a bit overdone.
Here is the .htaccess and wp-config.php code as it is now, maybe you have an idea how to deal with a mixed redirect situation. Unfortunately i don’t have php/sql/apache skills, only very basic knowledge how to set up stuff.
Thank you Achim
wp-config.php:
<?php
#if( isset( $_SERVER[‘HTTP_X_FORWARDED_SERVER’] ) ) {
# Zugriff mit SSL-Proxy
$_SERVER[‘HTTPS’]=’on’;
$_SERVER[‘HTTP_HOST’] = ‘ssl-proxy.com’;
$_SERVER[‘REQUEST_URI’]=’/my-domain.com’. $_SERVER[‘REQUEST_URI’];
define(‘COOKIE_DOMAIN’, ‘ssl-proxy.com’);
define(‘COOKIEPATH’, ‘/my-domain.com/’);
define(‘WP_SITEURL’, ‘https://ssl-proxy.com/my-domain.com’);
define(‘WP_HOME’, ‘https://ssl-proxy.com/my-domain.com’);
#}
#else {
## Zugriff ohne SSL-Proxy
# define(‘COOKIE_DOMAIN’, ‘my-domain.com’);
# define(‘WP_SITEURL’, ‘https://my-domain.com’);
# define(‘WP_HOME’, ‘https://my-domain.com’);
#}
…
.htaccess:
php_value memory_limit 256M
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# wp-(admin|login|register)* auf HTTPS umleiten, wp-login entfernt!
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-FORWARDED-SERVER} !^ssl-proxy\.com$ [NC]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^wp-(admin|login|register)(.*) https://ssl-proxy.com/my-domain.com/wp-$1$2 [L]
# xmlrpc* auch auf HTTPS umleiten
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-FORWARDED-SERVER} !^ssl-proxy\.com$ [NC]
RewriteRule ^xmlrpc(.*) https://ssl-proxy.com/my-domain.com/xmlrpc$1 [R=301,L]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
# Media Vault Rewrite Rules
RewriteRule ^wp-content/uploads(/_mediavault/.*\.\w+)$ index.php?mgjp_mv_file=$1 [QSA,L]
RewriteCond %{QUERY_STRING} ^(?:.*&)?mgjp_mv_download=safeforce(?:&.*)?$
RewriteRule ^wp-content/uploads(/.*\.\w+)$ index.php?mgjp_mv_file=$1 [QSA,L]
# Media Vault Rewrite Rules End
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress