Solved

Redirecting a url request for certain files in coldfusion

Posted on 2013-01-23
3
218 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

628 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