Solved

redirecting

Posted on 2004-04-11
6
140 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:penelope112358
Comment Utility
unfortunately, the default document is already assigned...
0
 
LVL 35

Expert Comment

by:mrichmon
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now