Custom Error Page redirecting to local URL
-
08-02-2021 - |
Frage
I have a Web Applcation which contains a Publishing Site with Variations feature enabled. The following is and example URL for the site http://test-server.com/en
However when I type a wrong URL, an error occurs it takes me to Page Not Found error page but the URL changes to the following:
http://windows-pc:29420/pages/PageNotFoundError.aspx?requestUrl=http://localhost:29420/en/whatsfa"
I want the URL to point to the following domain name URL:
http://test-server.com/en
and not to local URL like:
http://windows-pc:29420/pages/PageNotFoundError.aspx
How can I fix this problem?
Lösung
Here is PowerShell to set your page not found URL:
$spsite = Get-SPSite "Web site URL"
$spsite.filenotfoundurl
$spsite.filenotfoundurl = "/sites/yoursite/Pages/PageNotFoundError.aspx"
Besides, customizing the 404 Redirection in SharePoint for your reference:
https://www.chakkaradeep.com/2009/06/23/customizing-the-404-redirection-in-sharepoint/
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit sharepoint.stackexchange