Solved

Redirecting a url request for certain files in coldfusion

Posted on 2013-01-23
3
208 Views
Last Modified: 2013-01-26
How can I redirect to a default url if someone types in a url that I don't want them to view? Example, if someone types in http://www.mydomain.com/private I want them to be redirected to http://www.mydomain.com/public.
0
Comment
Question by:Envisoin
  • 2
3 Comments
 
LVL 39

Expert Comment

by:gdemaria
ID: 38812945
Put an index.cfm file at /private/  that has a CFLOCATION to the url you want it to go to..
0
 
LVL 15

Accepted Solution

by:
myselfrandhawa earned 500 total points
ID: 38822136
or you can use the meta tag to redirect in the index.html file rather than using the cfm file

<meta http-equiv="refresh" content="0;URL=http://www.mydomain.com/public" />

other way is just create a function like this:

<cfif listlast(cgi.script_name, "/") eq "index.cfm">
  <cflocation url="http://www.mydomain.com/public/index.cfm" addtoken="no">
</cfif>
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 38823470
huh?
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

16 Experts available now in Live!

Get 1:1 Help Now