This content has been marked as final. Show 7 replies
If relative addressing does not work, try absolute addressing.
Agreed. Start from the root and you can't go wrong with that.
I like to set an application variable in my application file and just set everything "absolutely" from there.
application.ServerRoot = "#Replace(GetCurrentTemplatePath(), "/Application.cfm", "", "all")#";
it works quite nicely.
Bare in mind that the URL in the <cflocation> tag is relative to the URL of
the request (and each relocate is a new request), and does not -
necessarily - have any bearing on the relative filesystem paths between the
file with the <cflocation> tag in it and the target of the <cflocation>
It doesn't sound - from your description - that this is your problem, but
it's worth being mindful of.
Why are you bouncing "through" page2.cfm, only to end up going to page3.cfm
What you wish to achieve should be possible if your code and path structure is something like
code <cflocation url="page2.cfm"> in
code <cflocation url="../../page3.cfm"> in
However, if instead you have
then the code you should use in page2.cfm to redirect to page3.cfm is
Thanks for all your replys,
Dan and CF_N_Montreal I’ve done that and that seemed to work.
Sean69, I have used GetCurrentTemplate and other Directory code in the past. I think I should continue using this where I can.
Adam, the reason I’m bouncing through page2 is that it has a standard routine in it. I could or should use cfIncluded maybe. This might work better I don’t know.
BKBK, Correct - I thought it should work this way and this is why I continued in trying to find out the problem.
I don’t know if this has any bearing on my problem but I had a missing DOCTYPE tag in my page. I put one in and the page worked!?!?
I will keep mypath ../../ for the moment, but once I get even one error page come through I’ll switch to one of the methods mentioned in this thread.
> Adam, the reason I?m bouncing through page2 is that it has a standard routine
> in it. I could or should use cfIncluded maybe. This might work better I don?t
<cflocation> does another trip back to the client browser, which you almost
certainly don't want. It's NOT a form of "goto" statement (and if it was,
you still shouldn't be using it in this case ;-), nor is it a way of
including code. So, yes, you should be using <cfinclude> or <cfmodule> or
something like that instead.