Overview
The default pages in the Site Settings display the site's default pages such as the home page and the 404 error page. This article details how to resolve access issues to this page.
Prerequisites
- Access to a SuperUser Account.
- SQL access to the server that DNN resides on.
- Backup your database before performing steps.
Diagnosis
When navigating to Persona Bar > Site Settings > Site Behavior > Default Pages no content is shown on the screen:
Normally, this page will show:
The reason for this behavior is that there are database entries that are referencing pages that don't exist in the DNN instance anymore.
Solution
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. Paste the following into the middle query box and then press F5 to execute:
SELECT DefaultTabs AS TabName, TabId AS DefaultTabID INTO DefaultTabChecker
FROM
(
SELECT PortalId, HomeTabId, LoginTabId, UserTabId, AdminTabId, SplashTabId, RegisterTabId, SearchTabId, Custom404TabId, Custom500TabId
FROM PortalLocalization
) AS P
UNPIVOT
(
TabId
FOR DefaultTabs in (HomeTabId, LoginTabId, UserTabId, AdminTabId, SplashTabId, RegisterTabId, SearchTabId, Custom404TabId, Custom500TabId)
) unpiv; DECLARE @NullTabId INT
DECLARE @NullTabName NVARCHAR(MAX)
DECLARE db_cursor CURSOR FOR
SELECT DefaultTabChecker.TabName, DefaultTabChecker.DefaultTabID FROM DefaultTabChecker LEFT JOIN Tabs ON DefaultTabChecker.DefaultTabId = Tabs.TabID WHERE Tabs.TabID IS NULL
OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @NullTabName, @NullTabId
WHILE @@FETCH_STATUS = 0
BEGIN
EXEC('UPDATE PortalLocalization SET ' + @NullTabName + ' = NULL WHERE ' + @NullTabName + ' = ' + @NullTabId)
FETCH NEXT FROM db_cursor INTO @NullTabName, @NullTabId
END
CLOSE db_cursor
DEALLOCATE db_cursor
DROP TABLE DefaultTabChecker
5. Clear your cache.
If you do not have access to the SQL Server but a SuperUser account, you can go to Settings > SQL Console and copy/paste the above script.
Testing
- Validate that the fix has worked by navigating to Persona Bar > Site Settings > Site Behavior > Default Pages.
- If successful, the default pages settings will show.
Comments
0 comments
Please sign in to leave a comment.