Certain pages in portal lead to a 404 error


When attempting to navigate to specific pages within the DNN instance, customers are reporting that they lead to a 404 error page. The customer has also validated that these pages do indeed exist within the portal. 


The affected pages were originally created under a parent page and then moved to be under a new parent page. Because of this, the page URLs have retained the .aspx modifier.


In order to fix this issue, you will need to completely remove the old system generated URLs so that the new URLs are created without the .aspx modifier. 

Requirements: SQL access to the DNN server

NOTE: Please make a backup of your database before running this or any other SQL query. 

1. Log in to SQL Server Management Studio.

2. In the left side Object Explorer, Double click on your server name and then Databases to expand. 

3. Find your DNN database and right-click to select New Query


4. Execute the following query to find the PortalID of the affected instance:

SELECT portalid from portalalias where httpalias = 'YOUR_WEBSITE_ADDRESS_HERE'

NOTE: In the above query, do not use http or https in your website address. 

5. Execute the following query to show a list of all the affected pages:

WHERE [Url] LIKE '%aspx%'
AND HttpStatus = 200
AND TabId IN (SELECT tabid from Tabs where PortalID = PORTAL_ID_FROM_STEP_4

6. Execute the following query to strip the aspx modifier from all the URLs:

SET [Url] = REPLACE(CAST([Url] as NVarchar(MAX)),'.aspx','')
WHERE [Url] LIKE'%aspx%'
AND HttpStatus = 200
AND TabId IN (SELECT tabid from Tabs where PortalID = PORTAL_ID_FROM_STEP_4)

7. Clear your cache

8. Validate the fix by logging back into the DNN instance and navigating to a page that previously led to a 404 error page. If successful, it should instead direct you to the intended page. 




Please sign in to leave a comment.