> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# 404 error page

> The two 404 pages of a WEBSALE V8s shop: the static 404.htm in the shop root and the notification page ws_notify.htm in the template directory.

This page describes which page a WEBSALE V8s shop delivers when a requested address does not exist, and how to set up the two pages responsible for it.

The messages "404 Error, Page not found", "Fehler 404, Seite nicht gefunden", or "The page you requested was not found" all mean the same thing: the page targeted does not exist. Which page the visitor then sees depends on whether the address called was recognized as a shop URL at all.

## Two types of 404 pages

WEBSALE distinguishes two pages that go to different depths.

| Page | Storage location | Is shown when | WEBSALE tags |
| - | - | - | - |
| static 404 page, for example `404.htm` | directly in the shop root | the address is **not** a shop URL | not possible |
| notification page `ws_notify.htm` | in the template directory of the shop | the address was recognized as a shop URL | all shop tags |

The difference is technical. If the address is not a shop URL, the shop is not called at all. There is then no session, no shopping cart, and consequently nothing that a tag could output. If, on the other hand, the address is recognized as a shop URL, the shop is running and can deliver a fully featured page.

> [!WARNING]
>
> Do not redirect the static 404 page and do not turn it into a shop template just to enable shop tags. This has two unwanted consequences.
>
> First, after a redirect, the server no longer returns a 404 message but an "OK". Search engines then never learn that a page no longer exists and do not remove it from the index.
>
> Second, your load units go up. Every request that does not find a file would be passed to the shop and billed there.

## 404 calls in WEBSALE V8s

If the SEO URLs are active, real 404 errors in WEBSALE V8s only occur in rare exceptional cases, for example with a missing product image. In the typical cases, an automatic 301 redirect to a current URL, to the home page, or, if configured, to a catch-all page takes effect instead.

Redirects take place in these cases:

* The shop is called with a link that is no longer current, for example after a change to the URL structure.
* The shop is called with a non-existent SEO URL.
* An information page is called that is no longer found in the shop.
* A product that is no longer available is called and neither a replacement product is defined nor is an available category or higher-level category up to level 1 present.
* A category that is no longer available is called and no available higher-level category up to level 1 exists.

Guide: SEO URLs, automatic 301 redirect&#x20;

A static 404 page is therefore not strictly necessary in WEBSALE V8s. Setting one up is still worthwhile, because it catches the remaining exceptional cases.

## Setting up the static 404 page

The usual 404 pages are visually unappealing and do not help the visitor. Since you design the page freely, you can instead actively lead the visitor back into the shop.

![404](https://mintcdn.com/websaleag-44ee7ea6/GhYeuPYs7oEmFYIy/images/404.png?fit=max\&auto=format\&n=GhYeuPYs7oEmFYIy\&q=85\&s=f63edcae289eb4ab66aed3138a4e7706)

### Storing the file

Create any HTML file and save it directly in the shop root, not, as usual, in the template directory. If you use several subweb directories, create a separate 404 file per directory.

Also store all files that this page needs in the same directory, for example stylesheets and graphics. The reason is the same as above: the page runs outside the shop and therefore cannot access the usual template paths.

### Assigning the template

By default, a `404.htm` template is already delivered in the shop root that you only need to adapt. If it is not present, assign a document via the `ErrorDocument 404` parameter in the `ws_access.conf` configuration file.

```apache theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
...
ErrorDocument 404 /404.htm
...
```

The assigned document must be located directly in the shop root.

> [!WARNING]
>
> Only edit `ws_access.conf` with an editor that produces Unix line breaks ("LineFeed"). Otherwise shops without SEO URLs will no longer be callable.
>
> If you do not have access to the root directory of your shop, contact your WEBSALE contact. They will arrange the adjustment for you.

### Designing the content

Create or edit the file under the name you assigned. The following example names the likely reason and offers two ways back, the home page and the contact page.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<body>

   <h1>Unfortunately, this page could not be found</h1>

   <p>Reasons for this could be that you called a wrong or outdated URL.
   Please check it again. Or we may have archived, moved,
   or renamed the location in question.</p>

   <p>Perhaps you can find the content you are looking for via our home page.
   <a href="https://your-domain.de">To the home page of our shop</a></p>

   <p>Or may we help you directly? Send us an email or simply give us
   a call.
   <a href="https://your-contact-page.de">Get in touch with us</a></p>

</body>
```

> [!WARNING]
>
> Neither WEBSALE tags nor WEBSALE bracketings are supported on this page. All links must therefore be noted as full addresses.

## Setting up the notification page ws\_notify.htm

The notification page is more than a 404 page. It also shows notices and error messages from the running shop, for example when an action could not be performed. In WEBSALE V8 without SEO URLs, it also always appears when categories, products, or information pages are not found.

You therefore still need this page in WEBSALE V8s as well, even though the 301 redirects catch most cases.

### Assign the template in the shop configuration

Specify the template in the `<Templates>` section of the shop configuration `shop.config` after the `Notify` parameter.

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<Templates>
   ...
   Notify = ws_notify.htm
   ...
</Templates>
```

Reference: Templates section&#x20;

### Create the template

Create the template under exactly this name in your template directory, for example `benutzer/templates/translation`.

The content consists of three building blocks. `MSG-Notify` outputs the actual message to the visitor. `MSG-InternalErrorMessage` contains errors that would otherwise only end up in the syslog. This output is intended for troubleshooting and is therefore commented out in the example so that no visitor sees it. `WS-NotifyBackLink` provides the way back to the previous page and only appears when such a return is possible.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
Important notice:

{MSG-Notify}
   ~MSG-Notify~
{/MSG-Notify}

<!-- For debugging: errors that are normally written via syslog and should not be visible to the visitor
  {MSG-InternalErrorMessage}
     ~MSG-InternalErrorMessage~
  {/MSG-InternalErrorMessage} -->

{WS-NotifyBackLink}
   <a href="~WS-NotifyBackLink~">back</a>
{/WS-NotifyBackLink}
```

Reference: MSG-Notify&#x20;


## Related topics

- [Server configuration ws_access.conf](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/server-konfiguration-ws-access-conf.md)
- [urls - URLs (web addresses)](https://dokumentation.websale.de/en/konfiguration/urls-url-webadressen.md)
- [Basics & architecture of Strapi](https://dokumentation.websale.de/en/strapi-cms/grundlagen-architektur-von-strapi.md)
- [Products and categories that are no longer available](https://dokumentation.websale.de/en/v8s/seo/nicht-mehr-verfuegbare-produkte-und-kategorien.md)
- [Data migration](https://dokumentation.websale.de/en/migration/daten-migration.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.