Page relocate question

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?
LVL 11
adonis1976Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PE_CF_DEVCommented:
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
adonis1976Author Commented:
our site is hosted outside, so I dont have access to the webserver. thanks for your help though.
0
MauseCommented:

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

<CFIF NOT len(cgi.HTTP_REFERER)>

</CFIF>
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

MauseCommented:
sorry this is the code:

<CFIF NOT len(cgi.HTTP_REFERER)>
   <cflocation url="http://www.domain.com/growth.cfm">
</CFIF>
0
adonis1976Author Commented:
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
PE_CF_DEVCommented:
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
MauseCommented:
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
adonis1976Author Commented:
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
MauseCommented:
NP, good luck
0
kjuliffCommented:
Just create the index.cfm and put in it the one statement
<CFLOCATION URL="http://www.domain.com/growth.cfm ">
0
dc197Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
adonis1976Author Commented:
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
dc197Commented:
Glad to have helped
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.