Solved

redirecting

Posted on 2004-04-11
6
143 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

813 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

15 Experts available now in Live!

Get 1:1 Help Now