Redirecting a url request for certain files in coldfusion

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.
EnvisoinAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Gurpreet Singh RandhawaConnect With a Mentor Web DeveloperCommented:
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
 
gdemariaCommented:
Put an index.cfm file at /private/  that has a CFLOCATION to the url you want it to go to..
0
 
gdemariaCommented:
huh?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.