Solved

redirecting

Posted on 2004-04-11
6
141 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
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.

 

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

Title # Comments Views Activity
connection string question 2 67
How to switch email hosts (part 2) 11 65
retrieving files from old server once DNS has changed 10 70
Stream live video from Raspberry Pi camera 22 112
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

930 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

13 Experts available now in Live!

Get 1:1 Help Now