Solved

Page relocate question

Posted on 2003-10-28
13
158 Views
Last Modified: 2013-12-24
Hi experts

Say I have a a file called "growth.cfm" which is in the root of the website. I have a request here from the customer that they want to get to that page by typing all 3 combinations as follows:

http://www.domain.com/growth
http://www.domain.com/growth/
http://www.domain.com/growth.cfm

i know that if there is a folder growth and there is an index.cfm file in that folder, I can do the first two options. But that is not an option 'cos of the site navigation structure which I dont want to change atleast now. I just have "growth.cfm" in the root and I want the customers to get to that file by typing the above 3 options. Is there is a way one can insert some code in growth.cfm and make it work?
0
Comment
Question by:adonis1976
  • 4
  • 4
  • 2
  • +2
13 Comments
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 9633863
If you are using IIS you can set up the redirects in IIS, it will automatically take them to growth.cfm without any ColdFusion scripts, not sure if that will mess with the nav structure if you need help setting that up let me know and I will post some instructions.

0
 
LVL 11

Author Comment

by:adonis1976
ID: 9633885
our site is hosted outside, so I dont have access to the webserver. thanks for your help though.
0
 
LVL 10

Expert Comment

by:Mause
ID: 9633943

you can try this in the http://www.domain.com/growth/index.cfm

<CFIF NOT len(cgi.HTTP_REFERER)>

</CFIF>
0
 
LVL 10

Expert Comment

by:Mause
ID: 9633953
sorry this is the code:

<CFIF NOT len(cgi.HTTP_REFERER)>
   <cflocation url="http://www.domain.com/growth.cfm">
</CFIF>
0
 
LVL 11

Author Comment

by:adonis1976
ID: 9633973
mause:

I dont have growth folder. I just have grwoth.cfm file in the root like

http://www.domain.com/growth.cfm

thanks for your help.
0
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 9634020
Mause’s idea is not reliant anyways, about 60% of the traffic to a website has their referral information blocked anyways...

To answer your question as far as I know there is nothing you can put in growth.cfm that will catch people going to another directory.
0
Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

 
LVL 10

Expert Comment

by:Mause
ID: 9634072
Hhmm OK.

I gues if you don't have access to the webserver you can't do this!
Or just make a directory '/growth/'

Mause
0
 
LVL 11

Author Comment

by:adonis1976
ID: 9634125
Mause:

I'm aware of that option, but the whole point is that I dont want to do it. I will wait for a while before I close this question. May be someone will have a better idea.

0
 
LVL 10

Expert Comment

by:Mause
ID: 9634192
NP, good luck
0
 
LVL 1

Expert Comment

by:kjuliff
ID: 9634228
Just create the index.cfm and put in it the one statement
<CFLOCATION URL="http://www.domain.com/growth.cfm ">
0
 
LVL 5

Accepted Solution

by:
dc197 earned 500 total points
ID: 9636430
If someone types domain.com/growth/
or
domain.com/growth/file.cfm
and the WEBSERVER does not have a mapping to redirect requests to /growth/ to /growth.cfm, you can't do much with coldfusion.  THis is because the webserver will look for the /growth/ folder which does not exist.

Are you using Apache?  You can add an HTaccess file.

Create a file called ".htaccess" and stick in the root of your folder.
This file should contain either:
RedirectMatch /growth/(.*) /growth.cfm
--or--
RedirectMatch /growth/(.*)  /$1

This forces any requests for the "/growth/" folder to be redirected to the file "/growth.cfm"
The second method remembers what the ask for, so if they type "domain.com/growth/foo.cfm" they end up at "domain.com/foo.cfm"

You don't need control over the server to do this.

Daniel

0
 
LVL 11

Author Comment

by:adonis1976
ID: 9637235
ok we have IIS here and not Apache. However I'm going to close this question. I learnt something new from dc197. So I will award the points to him. Thanks a bunch all.
0
 
LVL 5

Expert Comment

by:dc197
ID: 9637625
Glad to have helped
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Suggested Solutions

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now