Sunday, October 4, 2009

SSL Proxy breaks relative URLs

Hi, this seems a bit lengthy for IRC, so I thought I'd join the
Group..

I'm using an SSL proxy service as my webhoster doesn't offer real
https access for any domain.

It works like this: You prepend the proxy url to your domain:
https://sslproxy.com/mydomain.com/myapp/controller/action

But now, all relative URLs produced by Cake still point to /myapp/
controller/action which results in invalid requests when clicked, like
https://sslproxy.com/myapp/controller/action

The reason might be, that $_SERVER["HTTP_HOST"] is still mydomain.com
which is probably used by the Router class to construct URLs. The
proxy is just visible in $_SERVER["HTTP_X_FORWARDED_HOST"]

So in fact, I just need to prepend /mydomain.com to all relative URLs
if the proxy is used. Is there a way to do this? I tried $configure
["App.baseUrl"] but it doesn't seem to be made for this purpose.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: