You can accomplish that by doing the following:
- Make a template group called
404.group
and in that template group create an index.html
template (this will be your 404 template)
- Set "Enable Strict URLs" to "Yes" in your Global Template Preferences
- For the "404 Page" setting choose "404/index" (the template you created in step 1 above), again in your Global Template Preferences
In 404.gorup/index.html
put the following conditional
{if segment_1 != "404" OR segment_2 != ""}
{redirect="404/index"}
{/if}
This will ensure that when a 404 is triggered and your 404 template is shown, it will be further redirected to the vanity 404 URL of just /404
.
There are a couple potential downsides to doing this, though.
- You won't have a record of these 404 URLs in Google Analytics so that you can see what URLs are erroring.
- The http status will not actually be 404, but 302 (redirect). You could get around this by using the HTTP Header plugin and deliberately setting the status with
{exp:http_header status="404"}