Cflocation just shows Object Moved page

Hi Guys, migrating a site here from Railo v4 up to latest stable Lucee 5.3.8.201 (using installer, so tomcat 9 and java bundled) - all working well apart from an index.cfm page we have at the root of our site that does this:

<cflocation  url="/home/view" addtoken="false">

Instead of redirecting as it did in Lucee, it now shows a page saying:

‘Object Moved’ and does nothing? - the same is true for any other pages we have that use CFLOCATION

Is there an obvious config change here or has this functionality changed?

what does curl show when you call the page?

Hey Zack,

I get this when using curl on the root of the site.

HTTP/1.1 200 OK
Date: Thu, 02 Sep 2021 16:32:33 GMT
Content-Type: text/html;charset=UTF-8
Content-Length: 96
Connection: keep-alive
Cache-Control: private
Content-Language: en-GB
Location: /home/view
Server: Microsoft-IIS/10.0
Set-Cookie: cfid=96ac5b74-a367-4c0b-aefa-934718415efe;Path=/;Expires=Wed, 22-Sep-2021 18:10:37 UTC;HttpOnly
Set-Cookie: cftoken=0;Path=/;Expires=Wed, 22-Sep-2021 18:10:37 UTC;HttpOnly
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET

<html>
<head>
<title>Document Moved</title>
</head>
<body>
<h1>Object Moved</h1>
</body>
</html>

Ths http status is wrong, it should send some 301 or 302 status code. You need to find out where this 200 is being set.

Its very odd, this server was built yesterday so it only has IIS and Lucee installed (using the installer mentioned). I did also have IIS rewrite installed (microsoft) - tried removing that but made no difference…

I tried creating a test.cfm with the above code in the Lucee folder - C:\lucee\tomcat\webapps\ROOT and the redirect works fine! so must be IIS?

however the CURL request interestingly looked like this:

HTTP/1.1 302
Connection: close
location: https://www.google.co.uk
Content-Type: text/html;charset=UTF-8
Content-Length: 96
Date: Thu, 02 Sep 2021 19:53:26 GMT

<html>
<head>
<title>Document Moved</title>
</head>
<body>
<h1>Object Moved</h1>
</body>
</html>

Is this issue happening with the same test.cfm on IIS? Could also be something within your apps code, eg. some cfheader tag setting the status.

Ok so placed a test.cfm in wwwroot - which is empty except for IIS defaults and the same resullt from curl:

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html;charset=UTF-8
Location: https://www.google.co.uk
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 03 Sep 2021 05:59:49 GMT
Connection: close
Content-Length: 96

<html>
<head>
<title>Document Moved</title>
</head>
<body>
<h1>Object Moved</h1>
</body>
</html>

Ok found it after a LOT of tinkering!!!
In the Boncodejp13.settings file there’s a line for:

<EnableHTTPStatusCodes>False</EnableHTTPStatusCodes>

changing this to:

<EnableHTTPStatusCodes>True</EnableHTTPStatusCodes>

resolves my issue! Why on earth is this set to False by default???

This is really odd. I know this setting is always set to be true by default, as specififed at BonCodes docs.. How did you install Lucee? Installer? Which version?

That’s right, you have to specifically add the setting to make it false. It’s not there in any of my boncode settings files, and the current Lucee installer doesn’t appear to add it:

It wasn’t there in the VivioTech installer either:

1 Like

Pull requests are always welcome :slight_smile:

But it doesn’t look like there’s anything wrong with the installer(?).

true, pretty sure the installer won’t overwrite existing files, so it might be left over? dunno