redirecting Coldfusion without software installed
June 4, 2009 4:56 PM   Subscribe

My new webserver doesn't have Coldfusion so I am hosting my .cfm pages on another server. Can I redirect traffic to these new addresses using a .htaccess file or do I have to have the software installed to even get a redirect on a .cfm page? How would you do it?
posted by Foam Pants to Computers & Internet (6 answers total) 1 user marked this as a favorite
 
It sounds like you'd have to use a reverse proxy. What's the situation with the servers - are they part of the same local network, or are they, say, hosted by two different hosting companies?
posted by anarchivist at 5:26 PM on June 4, 2009


Response by poster: Not on the same network.
posted by Foam Pants at 9:38 PM on June 4, 2009


Do you want the browser to go to the old site for those pages, or you want the new server to fetch & pass along the pages from the other site? The first one's doable with htaccess. The second one doubles or triples your bandwidth usage, introduces latency, & breaks if either server has problems.
posted by Pronoiac at 1:01 AM on June 5, 2009


"Can I redirect traffic to these new addresses using a .htaccess file"

You could use htaccess + mod_rewrite to basically say..

If any request comes in for a www.mydomain.com/*/*.cfm file, 302 redirect them to cfm.mydomain.com/
posted by SirStan at 6:49 AM on June 5, 2009


This seems to work


RewriteEngine ON
RewriteRule ^(.+)\.cfm$ http://mynewdomaincom/cfm/$1.cfm

But I dont claim to be a rewrite pro.

myhost: $ wget vtwire1ess.com/a/b/c/d/r.cfm?x=3
--2009-06-05 14:01:23-- http://vtwire1ess.com/a/b/c/d/r.cfm?x=3
Resolving vtwire1ess.com...
Connecting to vtwire1ess.com||:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://mynewdomain.com/cfm/a/b/c/d/r.cfm?x=3 [following]
--2009-06-05 14:01:23-- http://mynewdomain.com/cfm/a/b/c/d/r.cfm?x=3
Resolving mynewdomain.com
Reusing existing connection to vtw1reless.com:80.
HTTP request sent, awaiting response... 404 Not Found
2009-06-05 14:01:23 ERROR 404: Not Found.
posted by SirStan at 7:03 AM on June 5, 2009


Response by poster: Wow, hey! It turned out to be a super easy solution. I just added .cfm to the MIME type as a text file. It then is able to get inside and render all of the html, enabling me to do a simple redirect. Wish I had thought of that first!
posted by Foam Pants at 11:44 AM on June 5, 2009


« Older I'm looking for some durable dark blue jeans.   |   $30,000 per gig? Really? Newer »
This thread is closed to new comments.