## Preparations
# in Admin Console
# go to {nav Website & Content > Structure & Data > Products} section
# on `Sections` tab add `Sub Products` category
# go to {nav Website & Content > Structure & Data > Products > Sub Products} section
# on `Products` tab add new product
# in IDE:
# open `platform/designs/default_design.des` template in `advanced` theme for editing
# right above `<inp2:m_RenderElement name="content" default_element="cms_content"/>` line add `[<inp2:m_FormAction/>]<br/>` line
## Part 1
* in Admin Console:
# go to {nav Configuration > Website > Advanced} section
# check "Enable SEO-friendly URLs mode (MOD-REWRITE)" checkbox and save changes
* on Front-End:
# open url of non-existing page (e.g. `/tra-la-la`)
# confirm, that 404 page is shown and HTTP response code is also 404
# go to {nav Products > Sub Products} section in top menu
# confirm, that products created before are shown
# add (must be in mod-rewrite mode) `?page=10` to the url (list must not have 10th page)
# confirm, that 404 page is shown and HTTP response code is also 404
## Part 2
* in Admin Console:
# go to {nav Configuration > Website > Advanced} section
# uncheck "Enable SEO-friendly URLs mode (MOD-REWRITE)" checkbox and save changes
* on Front-End:
# go to {nav Products > Sub Products} category using top menu
# click on the product name (a link) to open it's detail page
# note place above navigation bar, where added template line result is now showing
# confirm, that `%3Ap-1----` part from URL is show above navigation bar (the `1` is ID of created product)
# in the URL replace ID of product with `9999` (non-existing product id)
# confirm, that `%3Ap-9999----` part from URL isn't show above navigation bar (the `9999` is ID of non-existing product)
# use `Back` button of web browser to see correct product detail page again
# press `Buy Now` button to add product to cart
# confirm, that redirect to Shopping Cart page happened and `%3Ap-1----` is present in the URL (the `1` is ID of added product)
# locate part in URL, that looks like `%3Am141-` (the `141` is ID of category)
# change `141` (or whatever number is shown in your case) to `0`
# change `shop_cart` in the URL into `shopcart`
# confirm, that `%3Ap-1----` part from URL isn't show above navigation bar (the `1` is ID of product from URL)
## Part 3
* in IDE:
# disable debug mode in `/system/debug.php` file
# in any `kMainTagProcessor` class add `AlwaysNotFound` tag, that would call `$this->Application->UrlManager->show404();`
# replace content of `error_notfound` template in theme with `404 page`
# add `/themes/advanced/test.tpl` template with `<inp2:m_include template="platform/designs/default_design.des" pass_params="1"/>` content
# replace contents of `/themes/advanced/platform/designs/default_design.des.tpl` template with following:
```
lang=html
<inp2:m_DefineElement name="elem_test">
<inp2:m_AlwaysNotFound/>
</inp2:m_DefineElement>
<inp2:m_RenderElement name="elem_test" />
```
* in Admin Console:
# go to {nav Configuration > Website > Advanced} section
# ensure, that `Enable HTML GZIP compression` checkbox is checked (save changes if needed)
# go to {nav Configuration > Website > Themes} section
# press `Rescan Themes` button on toolbar
* in Web Browser:
# go to `http://www.website.tld/test.html` page
# confirm, that `Page Not Found` page is displayed, but url stays the same