Hi,
I have a multilanguage website with multiple contexts. Recently there was SSL certificate installed on the server to make access to manager more secure. So now the site's back-end and also front-end are accessible via both http and https schemes.
For each context I had specified
site_url = http://www.mysite.com/
OR e.g.
site_url = http://www.mysite.com/de/
etc.
As you can guess this hardcoded site_url caused some problems with https access. So I used the trick described here:
http://stackoverflow.com/questions/21704388/configuring-modx-revolution-to-work-with-both-http-and-https
to make site work under both schemes (http & https).
[For lazy readers] In short - site_urls were changed to read:
site_url = [[++url_scheme]]www.mysite.com/
OR e.g.
site_url = [[++url_scheme]]www.mysite.com/de/
etc.
which made work the most of the stuff where site_url get parsed.
for the rest there is small snippet:
$modx->config['site_url'] = $modx->config['url_scheme'] . substr($modx->config['site_url'], strlen('[[++url_scheme]]'));
return '';
which I call in each template.
Above trick works in the most cases. However I found one where it does not work.
I have a contact form using FormIt extra. And there is redirect hook which redirects to specified 'thank you page' once the form is processed.
Because of makeUrl() calls from FormIt (with hardcoded scheme = 'full') my redirect after form processing ends up on:
https://www.example.com/[[++url_scheme]]www.example.com/[[++url_scheme]]www.example.com/thank-you-page.html
instead of
https://www.example.com/thank-you-page.html
Do you have similar experience and have maybe some workaround for situation like this? It can behave similarly with different extras which use some redirecting or so.
Thank you in advance
[ed. note: smashingred last edited this post 12 years, 3 months ago.]