Dnn.Platform: PortalAlias Settings Not Correctly Observed

Description of bug

We just experienced this on the dnncommunity.org website. Basically, we installed under one URL, upgraded a couple of times, then added a new URL as primary and the original URL was still being used. From what I could tell, the first URL in the database was being used, despite a different domain name being specified as IsPrimary and Site Alias Mapping Mode being set to Redirect.

IMPORTANT: If this is indeed a bug, it could have massive impacts on the ecosystem. Websites may be incorrectly serving out the wrong domain names and the website owners may not have any clue that it’s happening.

Steps to reproduce

List the steps to reproduce the behavior:

  1. Install DNN 9.1.1 and use a specific URL (e.g., domain1.org, and www.domain1.org)
  2. Upgrade to DNN 9.2.2
  3. Upgrade to DNN 9.3.2
  4. Add another domain, and set it to be the primary site alias now (e.g., domain2.org (primary), and www.domain2.org)
  5. View the website using the new URL/portal alias

Current result

Originally, it was redirecting to the correct primary URL, but a lot of time, it doesn’t.

Expected result

The primary URL should be used when the setting exists and a HTTP 301 redirect should be performed is Redirect is the mapping mode.

Additional context

We managed to fix this by deleting the original primary alias (that was no longer primary) and adding it to the end.

Screenshots

image

Affected version

  • 9.3.2
  • 9.3.1
  • 9.2.2
  • 9.2.1
  • 9.2
  • 9.1.1
  • 9.1
  • 9.0

Affected browser

  • Chrome
  • Firefox
  • Safari
  • Internet Explorer
  • Edge

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 32 (28 by maintainers)

Most upvoted comments

Thanks. I’ll be trying to do some more testing and submit a pull request this friday.

Many hosting control panels have a built-in feature to redirect www versions, could this be the case?

No, this is on a pure windows server, no CP involved. I “fixed” it by removing the portalalias and re-adding it

So do we mark the property deprecated in 9.4.1 and remove this in 11 ?

Yup. It dates back to 3.x

Yes it should, but was curious to see if that plays in. Honestly I think that setting can just go away

Do you have a portalSetting value for DefaultPortalAlias