Solved

Redirecting a url request for certain files in coldfusion

Posted on 2013-01-23
3
214 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 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

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 …
PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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