{"id":18825405,"url":"https://github.com/outsystems/public-custom-404-plugin","last_synced_at":"2026-01-30T20:02:53.631Z","repository":{"id":183789708,"uuid":"670769078","full_name":"OutSystems/public-custom-404-plugin","owner":"OutSystems","description":"Repository with public code for the Custom 404 Plugin.","archived":false,"fork":false,"pushed_at":"2023-12-29T13:53:16.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-12T21:50:05.672Z","etag":null,"topics":["snyk-vanguard"],"latest_commit_sha":null,"homepage":null,"language":"XSLT","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OutSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-25T19:47:53.000Z","updated_at":"2024-11-14T15:51:03.000Z","dependencies_parsed_at":"2023-07-26T05:48:44.276Z","dependency_job_id":null,"html_url":"https://github.com/OutSystems/public-custom-404-plugin","commit_stats":null,"previous_names":["dawud-outsystems/public-custom-404-plugin","outsystems/public-custom-404-plugin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OutSystems/public-custom-404-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OutSystems%2Fpublic-custom-404-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OutSystems%2Fpublic-custom-404-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OutSystems%2Fpublic-custom-404-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OutSystems%2Fpublic-custom-404-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OutSystems","download_url":"https://codeload.github.com/OutSystems/public-custom-404-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OutSystems%2Fpublic-custom-404-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28918235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T19:10:10.838Z","status":"ssl_error","status_checked_at":"2026-01-30T19:06:40.573Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["snyk-vanguard"],"created_at":"2024-11-08T00:59:21.286Z","updated_at":"2026-01-30T20:02:53.615Z","avatar_url":"https://github.com/OutSystems.png","language":"XSLT","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Configuring custom 404 error screens\nPublic Documentation\n\n## Introduction\nThe OutSystems Platform handles unforeseen or unhandled errors that might occur in applications and displays feedback pages to end-users. You can create your own custom HTTP 404 (Not Found) error pages in Service Studio and configure them for your reactive applications.\nThis applies to both on-premise and cloud customers. The method described in the Customizing OutSystems Platform Pages for Unhandled Errors article is still valid for on-premise customers, although more prone to errors.\n\n## Create a custom error page\nThis will be the page that will be shown in your application when the user tries to access a page that does not exist. It is recommended to have your error page inside the application it was created for. In this case, our demo application is called MyStore and we will create an error page inside it.\n1. Add a new screen to that application. For this example, we named it “NotFound”, but you can call it as you want.\n2. Tweak it as you like.\n3. Publish it.\n\nWhen modifying your custom error page, you can add buttons and links to other pages or screens in the same application or domain. However, if you need to add a link to an external web page, you will need to specify the attribute `target` with the value `_top` to prevent unexpected behaviors.\n\n## Install the Forge plugin called “Custom 404 Plugin”\n1. Go to Forge and search for: Custom 404 Plugin.\n2. Install it in your factory.\n3. Reference it in your application.\n4. In the error page you create, edit the OnDestroy event and add a call to the action NotFoundOnDestroy. This step is very important as it cleans some internal configurations before navigating out of the NotFound page.\n\n\n## Create a shared configuration\nNow that you have an application that contains your custom error page, you need to create some redirect rules that make the OutSystems platform use it as the default error page of your applications. You will add these redirect rules to a shared configuration file and then associate it to your application. You can create as many shared configurations as needed.\n\nFor that you need to go to Forge and install the module “Factory Configuration” into your factory.\n1. In the Factory Configuration app, go to Shared Configurations.\n2. Create a new Shared Configuration.\n3. In Pre-made Samples select “Custom Handler (.NET)”.\n4. Click on the “Fill” button.\n5. Give it a name.\n\nNow you will have to modify its content so that it points to the custom 404 error page you just created. In our example, that screen is called “NotFound” and it is inside the same application we are tweaking, which is called “MyStore”. Please replace MyStore and NotFound by the name of your application and error page respectively.\n\nModify the value field, in the “httpErrors” section. It has to contain these three snippets:\nFirst one:\n```xslt\n\u003c!-- Define new Error page redirect string --\u003e\n\u003cxsl:param name=\"new404\" select=\"'..'/Custom404Plugin/NotFound.aspx?app=MyStore\u0026amp;page=NotFound'\"/\u003e\n```\nSecond one:\n```xslt\n\u003cerror statusCode=\"404\" path=\"/Custom404Plugin/NotFound.aspx?app=MyStore\u0026amp;page=NotFound\" subStatusCode=\"0\" responseMode=\"ExecuteURL\"/\u003e\n```\nThird one:\n```xslt\n\u003c!-- Change 404 redirect --\u003e\n\u003cxsl:template match=\"/configuration/system.web/customErrors/error/@redirect\"\u003e\n    \u003cxsl:attribute name=\"redirect\"\u003e\n        \u003cxsl:value-of select=\"$new404\"/\u003e\n    \u003c/xsl:attribute\u003e\n\u003c/xsl:template\u003e\n```\nClick on “Save”.\n\nCheck [this file](https://github.com/dawud-outsystems/public-custom-404-plugin/blob/main/CustomErrorHandler.xsl) for an example configuration.\n\nYou can have as many configurations as you want. Usually it will be one per application.\n\n## Apply the shared configuration to your apps\nNow that your configuration is ready, you need to specify which applications it will apply to.\n1. In Factory Configuration, go to eSpaces.\n2. Search for the application you want to apply the configuration to.\n3. Select it in the list.\n4. Choose your shared configuration in the dropdown menu.\n5. Click on the “Associate Shared Configuration” button.\n6. Repeat the process for all the applications you want to add a custom error page to.\n7. Republish all the modified applications in Service Studio.\nIf you want to define a custom error page for another application, you can follow the same steps and apply the configuration only for that application.\n\n## Optional: Configure a site rule\nIt might happen for a user to mistype the name of a specific application, for example typing `https://mysite.something/MyStoree` instead of `https://mysite.something/MyStore`. In that case, the error page associated with MyStore won’t be opened, as the user failed to access that specific module.\n\nIn order to address that situation, you need to define which application will be automatically opened when accessing your domain, and create a custom error page for it. This can be a blank application, or a real application with functionality. You can do that by configuring a site rule:\n1. Go to Service Center / Administration / SEO URLs / Site Rules.\n2. Click on New Site Rule.\n3. Write the domain of your OutSystems’ Platform in “Base URL”.\n4. Select your application in “Root Application”.\n5. Click on “Create”.\n6. Configure a custom 404 error page for it by following the steps explained before.\n7. Official documentation can be found at [this location](https://success.outsystems.com/Documentation/11/Developing_an_Application/SEO_in_Reactive_Web_Apps).\n\n## Troubleshooting common errors\nPlease note that modifying the XML is an error-prone operation. In case the XML modified in the previous step is invalid, Service Studio will show a warning message when republishing the modified application, saying that the config was invalid and will be disregarded. In that case, please review your configuration file.\n\nLook for the following common mistakes:\n### Not including single quotes:\n```xslt\n\u003c!-- Define new Error page redirect string --\u003e\n\u003cxsl:param name=\"new404\" select=\"'/Custom404Plugin/NotFound.aspx?app=MyStore\u0026amp;page=NotFound'\"/\u003e\n```\nMake sure the URL defined for the variable “new404” is between single quotes and double quotes simultaneously.\n\n### Mistyping URLs:\n```xslt\n\u003cerror statusCode=\"404\" path=\"/Custom404Plugin/NotFound.aspx?app=MyStore\u0026amp;page=NotFound\" subStatusCode=\"0\" responseMode=\"ExecuteURL\"/\u003e\n```\nMake sure to correctly type the URL, including:\n- your application name,\n- your not-found page name,\n- forward slashes,\n- question mark,\n- and escaping the ampersand\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutsystems%2Fpublic-custom-404-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foutsystems%2Fpublic-custom-404-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutsystems%2Fpublic-custom-404-plugin/lists"}