Re: referer problems on new server
I met this problem, but i don't know why Cake use HTTP_X_FORWARDED_HOST for referer ? Anyone know this ? On Tuesday, January 17, 2012 10:17:51 PM UTC+7, euromark wrote: > > I moved a project from a managed server to a server with some proxy > routing (apache mod_proxy). > > But now request::referer() is always the domain itself (not the actual > referrer url) due to > > $ref = env('HTTP_REFERER'); > $forwarded = env('HTTP_X_FORWARDED_HOST'); > if ($forwarded) { > $ref = $forwarded; > } > > The proxy setup is: > > ProxyRequests Off > > Order deny,allow > Allow from all > > ProxyPreserveHost On > ProxyPass / http://192.../ > ProxyPassReverse / http://192/ > > > HTTP_REFERER is set to the correct value "domain.com/some/action/with/ > params" > HTTP_X_FORWARDED_HOST, though, is only "domain.com" > > why would cake use the host name here instead of sticking to the > obviously correct referrer url? > thx for any clarification > I would like to avoid hacking the core method of the request class. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: referer problems on new server
hey guys. are there any experiences made yet in this field? does anyone operate a cake app behind a proxy (apache or otherwise) I still experience problems with a) HTTP_HOST b) refer(r)er which can either result from inadequate config settings or because they might not be handled well from apache or even cake. I would appreciate any feedback on this topic. thx On 17 Jan., 16:17, euromark wrote: > I moved a project from a managed server to a server with some proxy > routing (apache mod_proxy). > > But now request::referer() is always the domain itself (not the actual > referrer url) due to > > $ref = env('HTTP_REFERER'); > $forwarded = env('HTTP_X_FORWARDED_HOST'); > if ($forwarded) { > $ref = $forwarded; > } > > The proxy setup is: > > ProxyRequests Off > > Order deny,allow > Allow from all > > ProxyPreserveHost On > ProxyPass /http://192.../ > ProxyPassReverse /http://192/ > > HTTP_REFERER is set to the correct value "domain.com/some/action/with/ > params" > HTTP_X_FORWARDED_HOST, though, is only "domain.com" > > why would cake use the host name here instead of sticking to the > obviously correct referrer url? > thx for any clarification > I would like to avoid hacking the core method of the request class. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
referer problems on new server
I moved a project from a managed server to a server with some proxy routing (apache mod_proxy). But now request::referer() is always the domain itself (not the actual referrer url) due to $ref = env('HTTP_REFERER'); $forwarded = env('HTTP_X_FORWARDED_HOST'); if ($forwarded) { $ref = $forwarded; } The proxy setup is: ProxyRequests Off Order deny,allow Allow from all ProxyPreserveHost On ProxyPass / http://192.../ ProxyPassReverse / http://192/ HTTP_REFERER is set to the correct value "domain.com/some/action/with/ params" HTTP_X_FORWARDED_HOST, though, is only "domain.com" why would cake use the host name here instead of sticking to the obviously correct referrer url? thx for any clarification I would like to avoid hacking the core method of the request class. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php