Tuesday, December 29, 2009

Re: creating absolute links (including site)

Ok, I will have to try it out later!
I have Apache virtual host pointing to my applications webroot, which
is why I don't see a problem, even if I change the virtual host to
point to the application directory or the root directory.
Thanks for the info, enjoy,
John

On Dec 29, 4:38 pm, euromark <dereurom...@googlemail.com> wrote:
> the url may either be an array or a link
>
> well its fairly easy
> if you havewww.domain.de/myapp/... via mod_rewrite mapped to /myapp/
> webroot/
>
> if you use $html->url() or link() you get /myapp/controller/action
>
> now - include this link in the $html->link() again, you get /myapp/
> myapp/controller/action
> which of course results in 404s
>
> so never use them inside each other if you are working relatively to
> root (http://... full urls would work)
> even if you are working directly at top level - it would still be
> wrong as it would break as soon as you change the environment or try
> it out locally with localhost/... etc
>
> On 29 Dez., 13:51, John Andersen <j.andersen...@gmail.com> wrote:
>
> > Sorry, I just tried to move my document root away from the application
> > webroot, nothing was added to the url, it looks exactly like it always
> > do! Can you give an example of when the url will include additional
> > folders?
>
> > In your example, what is the content of the $url variable?
>
> > Enjoy,
> >    John
>
> > On Dec 29, 2:25 pm, euromark <dereurom...@googlemail.com> wrote:
>
> > > actually its even way easiert!
>
> > > $html->link($url, TRUE)
>
> > > does the trick
>
> > > the above solution from john might even be wrong in some cases
> > > (if you're not at the top level of your domain, it adds the folders to
> > > the webroot twice...)
>
[snip]

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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: