• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

URL Forward

Community Beginner ,
May 03, 2006 May 03, 2006

Copy link to clipboard

Copied

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
TOPICS
Advanced techniques

Views

617

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 03, 2006 May 03, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 03, 2006 May 03, 2006

Copy link to clipboard

Copied

don't use cflocation (cflocation is 302 temporary) for a permanent redirect. use cfheader to do a 301 redirect.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 03, 2006 May 03, 2006

Copy link to clipboard

Copied

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>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

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

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

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

</table>

ETC
....
<!-- STATIC LINKS END

-->
</body>
</html>

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)

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


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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 04, 2006 May 04, 2006

Copy link to clipboard

Copied

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

HTH;
&laz;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 05, 2006 May 05, 2006

Copy link to clipboard

Copied

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.

<script>
location.href='newPages/index.cfm
</script>
<cfabort>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 09, 2006 May 09, 2006

Copy link to clipboard

Copied

LATEST
Do you still need an answer to this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation