Weird URL Bug?

4 posts by 2 authors in: Forums > CMS Builder
Last Post: September 25, 2018   (RSS)

By theclicklab - September 17, 2018

Hi there, I have a weird issue where some urls show a 404 error if they start with the word "destinations" or "yacht" in them e.g. 

  • 404:
  • 200:


  • 404:
  • 200:¬†

See attached page code. I also checked the htaccess file and no weird rules in there. 

Any idea what might be causing this?

CMS Builder v3.14 + plugins (see attached)

By daniel - September 18, 2018


That is indeed a strange issue! The first thing I would want to check is if the 404 is being triggered by lines 19-20 in post.php because no $newsRecord was found, or if it's being triggered "natively" by the server and not loading post.php at all.

A simple way to do this would be to trigger a silent error by placing the following code around line 16 in post.php:

@trigger_error('DEBUG - Record Number: ' . whereRecordNumberInUrl(1));

And then trigger the 404 using one of the URLs in your post. Then, check the Developer Log in the Admin Menu to see if it logged this error. If it does, then we'll know that the request is reaching the page but the record is not being loaded correctly (it should also show what num - if any - is being grabbed from the URL). If no log entry shows up, then something in the server configuration (e.g. htaccess or apache configuration) is preventing this request from hitting the page.

Another thing I noticed, though it could just be a coincidence, is that the "problem words" also match two existing PHP files on your site - yacht.php and destinations.php. It may be worth looking into these pages as well.


PHP Programmer

By theclicklab - September 20, 2018 - edited: September 20, 2018

Yep, so we are getting the following show up in the error log:

#3686 - E_USER_NOTICE: DEBUG - Record Number: num = '274'
/home/luxurychartergroup/ (line 17)

I suspect its related to the php files with a similar name as well, but not sure what to do next, any suggestion?

By daniel - September 25, 2018


With this info, it seems likely to me that the cause of the 404 is not on this page itself. I would suggest checking through your include files (e.g. includes/headers.php) for any code that is checking for "yacht" or "destinations", or that can trigger a 404 error. If you're unable to find anything there, in order to troubleshoot further, we'll need to move this to a support ticket so I can have a look directly. You can start a ticket with this form:


PHP Programmer