Highlighted

How can I obfuscate by returning a 404 on random hits?

Community Beginner ,
Apr 11, 2019

Copy link to clipboard

Copied

I have a device portal for IoT that I want to respond with a 404 unless specific criteria are met, to obfuscate for robots, scanning, etc.  How do I force an IIS 404 error from a valid template?

TOPICS
Advanced techniques

Views

437

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How can I obfuscate by returning a 404 on random hits?

Community Beginner ,
Apr 11, 2019

Copy link to clipboard

Copied

I have a device portal for IoT that I want to respond with a 404 unless specific criteria are met, to obfuscate for robots, scanning, etc.  How do I force an IIS 404 error from a valid template?

TOPICS
Advanced techniques

Views

438

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 11, 2019 0
BKBK LATEST
Adobe Community Professional ,
Apr 22, 2019

Copy link to clipboard

Copied

In ColdFusion, you could achieve this in 2 steps:

1) In the IIS settings of the website, add the path to your custom 404 page. Make sure the first line of code in the 404 page, pnf.cfm, is:

<cfheader statusCode="404" statusText="Not Found">

For more on this, see Duncan's blog.

2) A suggestion for the code in any valid page that you wish to return a status 404

<!--- Define the criteria to be met, encapsulating them in a boolean, isSpecificSetOfCriteriaMet --->

...

<cfif (isSpecificSetOfCriteriaMet) >

   <!--- Put code here that executes when the criteria are met --->

<cfelse>

   <cflocation url="URL_of_pnf.cfm">

</cfif>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 22, 2019 0