RJLCustom404 logo RJLCustom404

Options reference

All 27 options are optional. Color options accept any CSS color (#004494, rgb(), hsl(), named). Length options accept any CSS length. Wrong types are ignored and the default is used. Every card links to the playground with that option applied.

Quick reference

Option Type Default What it does
pageTitle string "404 - Not Found" Browser tab title (document.title).
bodyBackgroundColor string "white" Page background color.
bodyFontColor string "black" Page text color.
autoText boolean false Fill unset text fields from the built-in phrase pools.
imgFileNames array [] (no image) The images you host.
imgPattern string "" (off) Path template for numbered images.
imgCount number 0 (off) How many images the pattern generates.
imgStartIndex number 1 First number used by the pattern.
imgBorderRadius string "50%" Corner radius of the image.
imgBoxShadow boolean false Show a shadow when the image is hovered.
imgBoxShadowSize string "5px" Spread of the hover shadow.
imgBoxShadowColor string "rgba(18, 0, 100, .4)" Color of the hover shadow.
maxImgWidth string "1000px" Maximum width of the image column.
imgResponsiveBreakpoints boolean true Re-flow the layout on small screens.
imgAlt string "404 Error" Alt text of the image.
actionIsBtn boolean true Render a button or a plain link.
btnColor string "blue" Button background color.
btnPulsate boolean true Pulse the button on load.
btnPulsateCount number 2 How many times the button pulses.
btnDisplayText string "Back to" Button or link label.
btnDisplayHostName boolean true Append the hostname to the label.
homeUrl string "/" Where the button, link and image point.
headerText string "404 - File not found" Main heading.
subHeaderText string "" (hidden) Paragraph under the heading.
headerTextColor string "" (inherits bodyFontColor) Heading color.
subHeaderTextColor string "" (auto) Sub-heading color.
headerTextPosition string "right" Where the text sits relative to the image.

Page and body

The document title, the body colors and the autoText switch.

pageTitle

string default: "404 - Not Found"

Browser tab title (document.title).

Sets document.title when the page renders. With autoText: true, leave it unset to receive a random title.

Accepts: any string

javascript
RJLCustom404({
  "pageTitle": "Oops - page not found"
});

bodyBackgroundColor

string default: "white"

Page background color.

Applied as background-color on <body>. Pair a dark value with a light bodyFontColor.

Accepts: any CSS color

javascript
RJLCustom404({
  "bodyBackgroundColor": "#0b1220",
  "bodyFontColor": "#e5e7eb"
});

bodyFontColor

string default: "black"

Page text color.

Applied as color on <body>. When it is black ("black", "#000", "#000000" or "rgb(0, 0, 0)") the sub-header is auto-lightened to #666 unless subHeaderTextColor is set.

Accepts: any CSS color

javascript
RJLCustom404({
  "bodyFontColor": "#1f2937"
});

autoText

boolean default: false

Fill unset text fields from the built-in phrase pools.

When true, any of pageTitle, headerText, subHeaderText and btnDisplayText that you did not set is filled from a shuffled pool of 50 phrases: no repeats until the pool is exhausted, remembered per hostname in localStorage. Fields you set always win, and an empty string counts as set. When the button label is auto-picked, the phrase also decides whether the hostname is appended, overriding btnDisplayHostName for that render.

Accepts: true | false

javascript
RJLCustom404({
  "autoText": true
});

Images

Which images you host, how they are picked, and how they look.

imgFileNames

array default: [] (no image)

The images you host.

One is picked at random on each load. With two or more, the shuffle queue is stored in localStorage so a visitor sees every image before any repeat. No images are bundled: unset or empty renders [[ No 404 image configured ]], and a file that fails to load renders [[ <path> not found ]]. Takes precedence over imgPattern.

Accepts: array of paths or absolute URLs

javascript
RJLCustom404({
  "imgFileNames": [
    "/img/404-a.png",
    "/img/404-b.png"
  ]
});

imgPattern

string default: "" (off)

Path template for numbered images.

Generates imgFileNames from a template. {n} is replaced by the number; {nn} and {nnn} zero-pad to that width. Requires imgCount. Ignored when imgFileNames is set.

Accepts: a path containing {n}, {nn} or {nnn}

Only used with imgCount.

javascript
RJLCustom404({
  "imgPattern": "/img/404-{nn}.png",
  "imgCount": 12
});

imgCount

number default: 0 (off)

How many images the pattern generates.

Number of paths produced from imgPattern, starting at imgStartIndex. Zero means unset.

Accepts: integer greater than 0

Only used with imgPattern.

javascript
RJLCustom404({
  "imgPattern": "/img/404-{n}.png",
  "imgCount": 6
});

imgStartIndex

number default: 1

First number used by the pattern.

Use 0 for zero-based file names. Must be 0 or greater.

Accepts: integer 0 or greater

Only used with imgPattern.

javascript
RJLCustom404({
  "imgPattern": "/img/404-{n}.png",
  "imgCount": 6,
  "imgStartIndex": 0
});

imgBorderRadius

string default: "50%"

Corner radius of the image.

Applied inline as border-radius. 50% makes a square image circular; 0 keeps square corners.

Accepts: any CSS border-radius value

javascript
RJLCustom404({
  "imgBorderRadius": "24px"
});

imgBoxShadow

boolean default: false

Show a shadow when the image is hovered.

When true, hovering the image shows box-shadow: 0 0 25px <imgBoxShadowSize> <imgBoxShadowColor> and the image settles from scale 1.05 to 1.02.

Accepts: true | false

javascript
RJLCustom404({
  "imgBoxShadow": true
});

imgBoxShadowSize

string default: "5px"

Spread of the hover shadow.

The spread value of the hover shadow; the blur is fixed at 25px. Only used when imgBoxShadow is true.

Accepts: any CSS length

Only used with imgBoxShadow.

javascript
RJLCustom404({
  "imgBoxShadow": true,
  "imgBoxShadowSize": "15px"
});

imgBoxShadowColor

string default: "rgba(18, 0, 100, .4)"

Color of the hover shadow.

Use rgba() or an 8-digit hex to control opacity. Only used when imgBoxShadow is true.

Accepts: any CSS color

Only used with imgBoxShadow.

javascript
RJLCustom404({
  "imgBoxShadow": true,
  "imgBoxShadowColor": "rgba(0, 148, 158, 0.5)"
});

maxImgWidth

string default: "1000px"

Maximum width of the image column.

Applied as max-width on the image container. The image scales down inside it and never exceeds the column.

Accepts: any CSS length

javascript
RJLCustom404({
  "maxImgWidth": "480px"
});

imgResponsiveBreakpoints

boolean default: true

Re-flow the layout on small screens.

When true, a resize handler collapses left/right layouts to a single column at 768px and below and tightens the container padding at 480px and below. Font sizes and button padding always adapt through CSS regardless of this setting.

Accepts: true | false

javascript
RJLCustom404({
  "imgResponsiveBreakpoints": false
});

imgAlt

New in 1.3.0
string default: "404 Error"

Alt text of the image.

The alt attribute of the rendered image, for screen readers and for the text shown if the image cannot be displayed.

Accepts: any string

javascript
RJLCustom404({
  "imgAlt": "A lost robot holding a map"
});

Button

The way home: a button or a plain link, its label and its destination.

actionIsBtn

boolean default: true

Render a button or a plain link.

true renders a <button class="custom404-button"> that navigates to homeUrl on click; false renders an underlined <a> in the surrounding text color. btnColor, btnPulsate and btnPulsateCount only apply to the button.

Accepts: true | false

javascript
RJLCustom404({
  "actionIsBtn": false
});

btnColor

string default: "blue"

Button background color.

Applied as background-color on the button. The button text is always white, so choose a color with enough contrast.

Accepts: any CSS color

Only used with actionIsBtn.

javascript
RJLCustom404({
  "btnColor": "#004494"
});

btnPulsate

boolean default: true

Pulse the button on load.

When true, the button scales from 1 to 1.1 and back over 2 seconds, btnPulsateCount times.

Accepts: true | false

Only used with actionIsBtn.

javascript
RJLCustom404({
  "btnPulsate": false
});

btnPulsateCount

number default: 2

How many times the button pulses.

Number of 2-second pulse cycles. 0 disables the animation even when btnPulsate is true. Must be 0 or greater.

Accepts: integer 0 or greater

Only used with actionIsBtn, btnPulsate.

javascript
RJLCustom404({
  "btnPulsateCount": 5
});

btnDisplayText

string default: "Back to"

Button or link label.

With btnDisplayHostName true the hostname is appended after a space, for example "Back to your-site.com". With autoText, leave it unset to receive a random label.

Accepts: any string

javascript
RJLCustom404({
  "btnDisplayText": "Take me home",
  "btnDisplayHostName": false
});

btnDisplayHostName

boolean default: true

Append the hostname to the label.

Appends window.location.hostname to btnDisplayText. Overridden per render when autoText picks the label.

Accepts: true | false

javascript
RJLCustom404({
  "btnDisplayHostName": false,
  "btnDisplayText": "Go home"
});

homeUrl

New in 1.3.0
string default: "/"

Where the button, link and image point.

The destination of the button, the plain link and the image link. Defaults to the site root; set it when your site lives in a subfolder or you want to send visitors somewhere more useful than the home page.

Accepts: any URL

javascript
RJLCustom404({
  "homeUrl": "/en/"
});

Header and text

The heading, the sub-heading, their colors and where the text block sits.

headerText

string default: "404 - File not found"

Main heading.

Rendered as <h3 class="custom404-header">. With autoText, leave it unset to receive a random heading.

Accepts: any string

javascript
RJLCustom404({
  "headerText": "Well, this is awkward."
});

subHeaderText

string default: "" (hidden)

Paragraph under the heading.

Rendered as <p class="custom404-subheader"> only when non-empty. With autoText, an explicit empty string keeps it hidden.

Accepts: any string

javascript
RJLCustom404({
  "subHeaderText": "The page you asked for is not here."
});

headerTextColor

string default: "" (inherits bodyFontColor)

Heading color.

Applied inline to the heading. Empty inherits bodyFontColor.

Accepts: any CSS color

javascript
RJLCustom404({
  "headerTextColor": "#00949e"
});

subHeaderTextColor

string default: "" (auto)

Sub-heading color.

Applied inline to the sub-heading. Empty uses bodyFontColor, lightened to #666 when bodyFontColor is black.

Accepts: any CSS color

javascript
RJLCustom404({
  "subHeaderText": "Nothing lives at this address.",
  "subHeaderTextColor": "#94a3b8"
});

headerTextPosition

string default: "right"

Where the text sits relative to the image.

"right": image on the left, text on the right. "left": text on the left, image on the right. "top": text above the image. Left and right collapse to a single column at 768px and below. Invalid values fall back to the default.

Accepts: "top" | "left" | "right"

javascript
RJLCustom404({
  "headerTextPosition": "top"
});

Before 1.3.0 the source declared "top" as the default but never applied it, so an unset option has always rendered the side-by-side layout. The declared default now matches what renders.

Validation and fallbacks

Every option is type-checked. A wrong type is dropped and the default is used. headerTextPosition must be top, left or right. btnPulsateCount and imgStartIndex must be 0 or greater; imgCount must be greater than 0 (zero means unset). imgPattern without imgCount, or the reverse, is ignored. Unknown keys are ignored.

Warnings are written with console.warn in the readable source. The minified build strips them, so if something is silently falling back, debug against custom404.js rather than custom404.min.js.

autoText phrase pools

Four pools of 50 phrases - 200 in total: page titles, headers, sub-headers and button labels. Each pool is shuffled (Fisher-Yates), drawn without repeats until it is empty, then reshuffled; the remaining queue is stored in localStorage per hostname, so a returning visitor keeps working through the pool. Half of the button labels append your hostname (Back to your-site.com), half stand alone (Beam me up!). When autoText chooses the label it also decides whether the hostname is appended, overriding btnDisplayHostName for that render. Setting subHeaderText: "" counts as set, so the sub-header stays empty.

Page titles 50 phrases
  1. 404 - Reality Not Found
  2. 404 - Gone Fishing
  3. 404 - Plot Twist: No Page
  4. 404 - The Void Stares Back
  5. 404 - Nope, Not Here
  6. 404 - Lost in Cyberspace
  7. 404 - Digital Tumbleweeds
  8. 404 - Abandon All Hope
  9. 404 - Wrong Turn Ahead
  10. 404 - The Great Vanishing
  11. 404 - Page on Vacation
  12. 404 - Ghost Page
  13. 404 - Into the Unknown
  14. 404 - Off the Map
  15. 404 - Down the Rabbit Hole
  16. 404 - Page Not Available
  17. 404 - Content Missing
  18. 404 - Resource Not Found
  19. 404 - Page Unavailable
  20. 404 - File Not Located
  21. 404 - Destination Unknown
  22. 404 - Missing Content
  23. 404 - Not on This Server
  24. 404 - Page Does Not Exist
  25. 404 - Link Broken
  26. 404 - Nothing Here
  27. 404 - Content Removed
  28. 404 - Page Relocated
  29. 404 - Invalid Address
  30. 404 - Document Not Found
  31. 404 - Requested Page Missing
  32. 404 - Out of Bounds
  33. 404 - No Matches Found
  34. 404 - Location Not Found
  35. 404 - Endpoint Missing
  36. 404 - Whoops! Dead End
  37. 404 - Well, This Is Awkward
  38. 404 - Looks Like a Dead Link
  39. 404 - Page Took a Day Off
  40. 404 - This Link Needs Coffee
  41. 404 - Houston, We Lost a Page
  42. 404 - Detour Required
  43. 404 - You Zigged, Page Zagged
  44. 404 - Turn Back, Traveler
  45. 404 - Uncharted Territory
  46. 404 - This Page Escaped
  47. 404 - Bermuda Triangle of URLs
  48. 404 - Warp Zone Malfunction
  49. 404 - One Small Step, Wrong URL
  50. 404 - The Page Has Left the Building
Headers 50 phrases
  1. Oops! You found a hole in the internet.
  2. This page ran away from home.
  3. Looks like someone moved the furniture.
  4. The page you wanted is playing hide and seek.
  5. Error 404: Enthusiasm not found.
  6. Well, this is embarrassing.
  7. We sent a search party. They got lost too.
  8. Plot twist: the page was inside you all along.
  9. This page called in sick today.
  10. You've reached the edge of the internet.
  11. The hamsters powering this page took a break.
  12. Our digital janitor swept this page away.
  13. This page left to find itself.
  14. Someone unplugged the internet here.
  15. This page is on a coffee break.
  16. Page Not Found
  17. The page you requested could not be found.
  18. This content is no longer available.
  19. We couldn't locate that page.
  20. The requested resource does not exist.
  21. This URL does not match any page on our site.
  22. Sorry, this page doesn't exist.
  23. We can't find the page you're looking for.
  24. The content at this address has been removed.
  25. This page has been moved or deleted.
  26. No page exists at this address.
  27. The link you followed may be outdated.
  28. This destination could not be reached.
  29. Sorry, nothing here.
  30. That page isn't available right now.
  31. The page you're after doesn't live here.
  32. Hmm, we can't seem to find that one.
  33. Looks like this page packed its bags.
  34. This page wandered off somewhere.
  35. Not the page you were hoping for.
  36. Somewhere, somehow, this page went missing.
  37. This content has vanished into thin air.
  38. End of the road. No page ahead.
  39. A wrong turn brought you here.
  40. Nothing to see here. Literally.
  41. 404: File Not Found
  42. The resource could not be loaded.
  43. That link appears to be broken.
  44. This path leads nowhere.
  45. Requested content unavailable.
  46. We hit a dead end.
  47. This page seems to have wandered off.
  48. You've ventured into uncharted territory.
  49. The map says the page should be here...
  50. Uh-oh, this page went on an adventure.
Sub-headers 50 phrases
  1. Maybe try the homepage? It's lonely without you.
  2. The good news: everything else still works!
  3. We blame the intern. (Just kidding, we don't have one.)
  4. Even the best explorers take a wrong turn sometimes.
  5. If it helps, we're just as confused as you are.
  6. Fun fact: this page loads faster than the one you wanted.
  7. The page may have been abducted by aliens. We're investigating.
  8. On the bright side, you discovered our 404 page!
  9. This is not the URL you are looking for.
  10. Somewhere a developer is frantically checking the logs.
  11. Quick, look busy while we figure this out.
  12. The page must be on the other internet.
  13. Try turning the URL off and on again.
  14. We'll file a missing page report right away.
  15. Don't worry, it happens to the best of URLs.
  16. The page you're looking for may have been moved or deleted.
  17. Please check the URL and try again.
  18. Use the button below to return to our homepage.
  19. The content at this address is no longer available.
  20. If you followed a link, it may be outdated.
  21. You can navigate back to find what you need.
  22. This page may have been removed during a recent update.
  23. Try searching our site or browse from the homepage.
  24. We apologize for the inconvenience.
  25. The resource you requested could not be located on this server.
  26. Please verify the address and try again.
  27. Return to the homepage to continue browsing.
  28. The URL may contain a typo. Double-check and retry.
  29. This link may have expired or been removed.
  30. We're sorry, but that page isn't here anymore.
  31. Head back and try a different path.
  32. Looks like you need a detour. Try the homepage.
  33. We couldn't match that URL to any content.
  34. Sorry about that! Use the link below to get back on track.
  35. Not to worry, there's plenty more to explore.
  36. This isn't where you meant to be, but we can help.
  37. Our records show this page no longer exists.
  38. It's possible the page was moved to a new location.
  39. Click below to head somewhere that actually exists.
  40. The internet is vast, and you just found an empty spot.
  41. Check your bookmarks, this address may have changed.
  42. Feel free to browse our other pages instead.
  43. We keep things tidy around here, and this page was swept up.
  44. The trail ends here. Let us point you in the right direction.
  45. Happens to everyone. Let's get you back on track.
  46. That page has gone to a better place. Try the homepage.
  47. The server couldn't find what you were after.
  48. No worries! Click the button and we'll take you home.
  49. Sometimes pages just disappear. This was one of them.
  50. Double-check the URL or head to the homepage.
Button labels 50 phrases
  1. Back to + hostname
  2. Return to + hostname
  3. Go back to + hostname
  4. Head back to + hostname
  5. Get back to + hostname
  6. Go to + hostname
  7. Head to + hostname
  8. Navigate to + hostname
  9. Continue to + hostname
  10. Proceed to + hostname
  11. Visit + hostname
  12. Take me to + hostname
  13. Let's go to + hostname
  14. Carry on to + hostname
  15. Hop back to + hostname
  16. Bounce back to + hostname
  17. Jump back to + hostname
  18. Dash back to + hostname
  19. Swing by + hostname
  20. Pop over to + hostname
  21. Cruise back to + hostname
  22. Skip back to + hostname
  23. Zip back to + hostname
  24. Stroll back to + hostname
  25. Find my way to + hostname
  26. Get me outta here!
  27. Go Home
  28. Beam me up!
  29. Abort mission!
  30. Run away!
  31. Panic!
  32. Take me home
  33. I want out!
  34. Back to safety
  35. Retreat!
  36. Let's bounce
  37. Nope, go back
  38. Hit the eject button!
  39. To the homepage!
  40. Help, I'm lost!
  41. Where's the exit?
  42. I'm outta here
  43. Make it stop!
  44. Just go home
  45. Wrong way!
  46. This way out
  47. Rescue me!
  48. Find the exit
  49. Escape!
  50. Eject! Eject! Eject!