Skip to main content
Participating Frequently
October 29, 2007
Question

Page Re-direct from Application.cfm file

  • October 29, 2007
  • 5 replies
  • 5076 views
I am trying to do a page re-direct from Application.cfm file based on a particular application variable. I have tried both the below mentioned options, but it didn't work

1) Javascript - location.href
2) <CFLOCATION> tag

I need to pass the value of the application variable in the URL to the next page. The page keeps on spinning and it's not reaching the destination. But I have one more redirect in the same page which is working fine.

Pls advice

Thanks in advance
    This topic has been closed for replies.

    5 replies

    Inspiring
    November 1, 2007
    I believe he is trying to shut down the whole site although may be wrong. I'm not entirely clear.


    Also there are some links that might help give some finer control over the start of each request and which pages are shut down, etc.

    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=appFramework_12.html

    http://fusebox.org/
    Inspiring
    October 31, 2007
    I think you have to do it like this.

    Application.cfm file:-----------------------------------

    ...
    ...
    <cfif isDefined("whatever")>
    <cfoutput>Site is closed. So sorry.</cfoutput>
    <cfabort>
    </cfif>
    Participating Frequently
    October 31, 2007
    Thanks.. But I will tell you the complete requirement. I have a page with the a line of text as " Site Temporily Closed" When I want to do some kind of maintenance activities, i need to have this msg displayed to all the users. The info about site (closed or open) comes from the application variable. So i need to have this validation in Application.cfm or else all the users in diff pages will not get this error msg.If I place this check (a=b) in a particular page, then the user accessing that page alone will get this error msg.

    Thanks,
    Rams
    Inspiring
    October 31, 2007
    quote:

    Originally posted by: rtj_ram_tcs
    Thanks.. But I will tell you the complete requirement. I have a page with the a line of text as " Site Temporily Closed" When I want to do some kind of maintenance activities, i need to have this msg displayed to all the users. The info about site (closed or open) comes from the application variable. So i need to have this validation in Application.cfm or else all the users in diff pages will not get this error msg.If I place this check (a=b) in a particular page, then the user accessing that page alone will get this error msg.

    Thanks,
    Rams

    How are you maintaining the data regarding which pages are open and which are not?
    Inspiring
    October 31, 2007
    I'm not sure why you would handle page routing on the Application page. If you are at Page X and call Page Y, it should go there hitting Application.cfm on the way. If you have some sort of if/else statement you are trying to implement in Application.cfm I would probably suggest handling that logic in the pages of your application. E.g: Page X says if(a=b) Page Y else Page Z. More explanation of what you are trying to do might help.
    Participating Frequently
    October 30, 2007
    It sounds like you are redirecting the page and then calling that same Application.cfm file after the redirect causing and endless loop of cflocation tags.
    Participating Frequently
    October 31, 2007
    Yes. I think that's the way its working.

    But is there a way for me to re-direct to a page and stop there without calling application.cfm again in the new redirected page

    Thanks much for your reply.