0
votes

This question is follow-up for this topic: Configuring MODx Revolution to work with both http and https. For even more details see this MODX forum post

I face the same problem as described there and I use suggested solution. Just in my case I found the situation when it does not work.

I use MODX extra called FormIt (you probably know it) - it processes the forms and then redirects to 'thank you' page. What I have problem with is this redirect. It also uses makeUrl() but the snippet mentioned in the original post does not help here because in FormIt class the whole context config is regenerated, so site_url contains again [[++url_scheme]] and redirect ends in address like:

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

I wonder if you could know about some workaround, please?

thank you in advance!

1

1 Answers

0
votes

Succeeded to resolve the issue.

What helped was to create new hook which does something like:

$modx->config['site_url'] = $modx->config['url_scheme'] . substr($modx->config['site_url'], strlen('[[++url_scheme]]'));

and then add this hook right before redirect hook in FormIt call