Solved

redirecting

Posted on 2004-04-11
6
146 Views
Last Modified: 2013-12-24
Hi,

I would like do redirect www.MyDomain/demo to: MyPath/Demo01.cfm.

I tried:

<CFIF server_name IS "www.MyDomain/demo">
<CFLOCATION url="MyPath/Demo01.cfm">
</CFIF>

but that didn't work, probably:

1. because server_name cannot be a path.
2. demo has no extension. But to make it as easy as possible, I would not want the user to have to enter an extension to demo

Could anyone help with this?

Thanks,
            Penelope
0
Comment
Question by:penelope112358
6 Comments
 
LVL 9

Expert Comment

by:shooksm
ID: 10801494
Actually, you want to check on two things:

<cfif CompareNoCase(CGI.SERVER_NAME, "www.mydomain.com") EQ 0 AND CompareNoCase(ListGetAt(CGI.PATH_INFO, 1, "/"),"demo") EQ 0>
     <cflocation url="MyPath/Demo01.cfm">
</cfif>
0
 

Author Comment

by:penelope112358
ID: 10803973
Hello,

Thanks for your reply.
With the above script  I get a "You are not authorized to view this page" error with www.mydomain.com/demo


Penelope
0
 
LVL 17

Expert Comment

by:anandkp
ID: 10804217
do one thing - set up demo.cfm as a default document when someone enters www.domain.com/demo in ur web server

that shld handle things - also there's a way to set it up to another folder altogether ... i'll get back to u on that ...
0
Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 

Author Comment

by:penelope112358
ID: 10804378
unfortunately, the default document is already assigned...
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10806212
Well use whatever is set up as the default document and then use javascript to do the re-location (if the defualt document type is something.html or htm where you don't have serverside options)
0
 
LVL 9

Accepted Solution

by:
shooksm earned 250 total points
ID: 10806272
I should mention that you need to configure your server to direct errors like the 403 and 404 to a Cold Fusion page with my sample code for this to work if you do not already have an index or default document in the demo folder.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

713 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