|
I know I asked this question awhile ago, but I am still
trying ti find a solution as to why Coldfusion is not doing this
right.
With all the help I got I ended up using Spike's
routine to check a url, but the problem is that with a redirection using
coldfusion it still errors with the incorrect method.
http://www.choicecakes.com.au is
redirected to pages/default.cfm?page_id=12762 and cfhttp spits the dummy with
this and I need to know why, or at least find a solution as to why this is
happening. Coldfsion is throwing the 503 response code on this when it shouldn't
be...
Anyone know why or know how I can get around
this.
The
routine is here
<cffunction name="checkURL"> <cfargument name="myURL" type="string" required="true" /> <cfhttp url="" redirect="false" /> <cfset var sc = left(cfhttp.ResponseHeader.status_code,1)> <cfif sc eq 3> <cfif cfhttp.ResponseHeader.location EQ myURL> <cfthrow type="checkurl.error" message="Infinite redirect"/> </cfif> <cfset checkURL(cfhttp.responseheader.location) /> <cfelseif sc EQ 5> <cfthrow type="checkurl.error" message="Internal server error"> <cfelseif sc EQ 4 > <cfthrow type="checkurl.error" message="Not found"> </cfif> </cffunction> <cftry> <cfset checkURL("http://www.ikea.com.au/") /> <cfoutput>That URL is Fine</cfoutput> <cfcatch> <cfoutput>That URL has something wrong with it: #cfcatch.message#</cfoutput> </cfcatch> </cftry>
You are currently subscribed to cfaussie as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/ |
