close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

PowerCMS Template pages - non-existent pages default to show most recent ID

Thread began 11/12/2019 4:40 am by MagsW | Last modified 11/13/2019 11:55 am by Ray Borduin | 27 views | 4 replies |

MagsW

PowerCMS Template pages - non-existent pages default to show most recent ID

I have a PowerCMS template page set up to display surveys in a repeating list. The URL for a typical survey would be, for example:

www.mysite.com/survey-detail?ID=survey-title

However, if someone tries to access a non-existent survey (for example one that's been deleted from the site), instead of getting a page not found error it's defaulting to show the most recent survey instead. In fact, you can add any words you like after ?ID= and it will still show the most recent survey. I've never seen this before - how can I prevent it from happening?

Sign in to reply to this post

Ray BorduinWebAssist

You would have to add a recordset to the top of the page and check to see if there was a valid result and redirect. I could help with that if you send me your FTP information and a sample URL to test with.

Sign in to reply to this post

MagsW

Hi Ray, that would be great thanks - details in PM section.

Sign in to reply to this post

Ray BorduinWebAssist

You are already getting the content from a recordset, so you just have to look to see if there is a result and redirect if there isn't. I added this code below the recordset:

php:
<?php

if (!$row_rsSurveys){
  
header("location: https://www.vetprofessionals.com/site/404");
  die();
}
?>
Sign in to reply to this post

MagsW

Many thanks Ray, working perfectly now!

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...