Solved

redirecting

Posted on 2004-04-11
6
144 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to Eclipse 16 132
wordpress limitations 4 124
Apache SSL and mod_rewrite not working 8 185
How to install a renewed SSL certificate on Windows 2012 server 7 92
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…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 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