Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
site_url and https
Wondering if it might be possible to have the <txp:site_url />
tag produce a secure link i.e https://domain.com
instead of http://domain.com
? In my case I’d like to guide a user to a secure data submission page via a menu. I think rah_replace
could be used for this, but something native like <txp:site_url scheme="https" />
would be awesome.
Offline
Offline
Re: site_url and https
+1 & maybe an option for www or non www too…. maybe as a global preference???
Offline
Offline
Re: site_url and https
It would also be nice to have the option for the admin side too
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: site_url and https
Sounds fair, maybe open a github issue for this?
Offline
Offline
Re: site_url and https
I use this scheme: web_users
—> nginx:443(SSL)
—> apache:80(textpattern)
nginx(if needed) set header HTTPS = on
, but apache(textpattern) see it as HTTP_HTTPS = on
so can not determine the https protocol.
Fast fix(for me) add in config.php line
if( empty($_SERVER['HTTPS']) && !empty($_SERVER['HTTP_HTTPS']) ){ $_SERVER['HTTPS'] = $_SERVER['HTTP_HTTPS']; }
My site can be https/http requests, so I can not hard-code https protocol.
aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)
Offline
Re: site_url and https
I looked how https detected in other applications, for example, in phpMyAdmin.
if (PMA_getenv('HTTP_SCHEME')) { $url['scheme'] = PMA_getenv('HTTP_SCHEME'); } elseif (PMA_getenv('HTTPS') && strtolower(PMA_getenv('HTTPS')) == 'on') { $url['scheme'] = 'https'; // A10 Networks load balancer: } elseif (PMA_getenv('HTTP_HTTPS_FROM_LB') && strtolower(PMA_getenv('HTTP_HTTPS_FROM_LB')) == 'on') { $url['scheme'] = 'https'; } elseif (PMA_getenv('HTTP_X_FORWARDED_PROTO')) { $url['scheme'] = /*overload*/mb_strtolower(PMA_getenv('HTTP_X_FORWARDED_PROTO')); } elseif (PMA_getenv('HTTP_FRONT_END_HTTPS') && strtolower(PMA_getenv('HTTP_FRONT_END_HTTPS')) == 'on') { $url['scheme'] = 'https'; } else { $url['scheme'] = 'http'; }
phpMyAdmin is often used by SSL connection and this code has already been tested by many people.
Maybe that tells us how to solve the problem more correctly.
Last edited by makss (2015-06-05 05:34:50)
aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)
Offline
Pages: 1