Solved

Redirecting a url request for certain files in coldfusion

Posted on 2013-01-23
3
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 16

Accepted Solution

by:
Gurpreet Singh Randhawa 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…

730 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