6 Replies Latest reply on May 9, 2006 7:24 AM by drforbin1970

    URL Forward

      Hello all,

      I have some static coldfusion links through out my site (like Contact details,company details,Privacy..etcc) and
      are going to be updated by using contribute.

      And these links are in so many pages(hard coded links) and without touching my files(over 100) or going through version control for all these files, is there any simple way I can URL forward to a new page where my contribute
      files are?

      for example right now in my index.cfm page I have links like

      <a href = "/contactDetails.cfm">Contact details</a> and I don't want to change this code but forward to the new page
      where my contactDetails_Contribute.cfm file is there.

      Please help me out how I can do this or where I need to write the forwarding code with an example?

      Thanks in advance
      have a good day
        • 1. Re: URL Forward
          Not sure if I am following what you want to do here, but this is what I *think* you are trying to do. You want to leave all the links (lets say 50 of them) pointing to the same file (only one destination file destination.cfm lets say), but you want to redirect them from that page to a new page when the link is clicked? You can redirect them from the current destination.cfm page by adding the <cflocation url="newpage.cfm"> tag.

          Again, sorry if this is not what you are asking for.
          • 2. Re: URL Forward
            don't use cflocation (cflocation is 302 temporary) for a permanent redirect. use cfheader to do a 301 redirect.
            • 3. Re: URL Forward
              Tpaul Level 1
              Thanks for the update guys.
              I think that I have NOT asked the question in the right way.

              Here is what I need to do. I have over 100 coldfusion files and all of these files have some static links as i have specified earlier (like company details,about company etc).

              Since we didn't have a common header or footer,all the static links have been hardcoded in all the coldfusion files like following.

              one of my page looks like this.

              <SOME COLD FUSION CODE>
              <title>Untitled Document</title>
              <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

              <SOME COLD FUSION CODE>
              <SOME COLD FUSION CODE>

              <!-- STATIC LINKS -->
              <a href="/companyContact.cfm" title="company Contact Details"><u>company Contact</u></a>

              <a href="/AboutCompany.cfm" title="AboutCompany"><u>About Company</u></a>


              <!-- STATIC LINKS END


              Since I have the above code (static links) over 100 pages and I don't want to go to each page and change the code (and version controlling all the files) by using <CFLOCATION> tag or by changing the href parameter.

              So I need to send the user to a new CF page(s) when the user clicks the static links (company details or about company etc) without touching the existing code. Is that possible with any of the coldfusion tags or functions?

              note: NEW CF page (All of the new files are located in a different folder with different file names and was generated by contribute)

              old File name : AboutCompany.cfm
              New File name : newPages/AboutCompany_Contribute.cfm

              Hope I made some sense this time.
              Plese let me know

              • 4. Re: URL Forward
                Your remaining option appears to be, if I am understanding the thread correctly, to use your web server software to perform redirection at the request level, thus avoiding the need for anything in code. Depending on your web server software, this can be easy or difficult:

                - Apache mod_alias, if you are lucky enough to be using Apache: Version 1.x, Version 2.x

                - URL redirection in Microsoft Internet Information Server: Version 6

                - For most current versions of the server formerly known as iPlanet, Using SAFs in Sun One Web Server

                And just for good measure, an excellent write-up about why you should consider touching the code and using 301 redirects per imstillatwork's suggestion above: Permanent Redirect with HTTP 301

                • 5. Re: URL Forward
                  drforbin1970 Level 1
                  Why not just redirect your index.cfm page to the new directory inside your APPLICATION.CFM located in the 'old' dir? That way your hardcoded links should resolve correctly. Make sure you have an APPLICATION.CFM in the new directory or CF will check the directory structure back up the heirarchy until it finds one and that could cause a loop.

                  • 6. Re: URL Forward
                    drforbin1970 Level 1
                    Do you still need an answer to this?