Question

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?

Était-ce utile?

La solution

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/

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top