dotnetnukedotnetnuke-9dnn9

inner page getting local host alias in DNN9


i am using DNN9 and getting issue as images taking localhost alias in inner page while home page it working properly.

in portalalias table i have two alias

www.mydomain.com

localhost

i have images in inner page

<img src="/portals/_default/skins/test/test.png" alt="">

it it taking localhost alias that is incorrect while home page it works (www.mydomain.com/portals/_default/skins/test/test.png)

Thank you..


Solution

  • Any links that are root-relative, start with the '/' character, will take on the domain name that was used to load the page. If you are seeing /portals/_default/skins/test/test.png loading with a localhost request, the page itself was loaded with localhost.

    There are a few things that could be causing this, however, your best bet will be to mitigate the issue.

    1. By marking the www.mydomain.com alias as the "Primary" alias you can force DNN to use it
    2. You can also set a Portal Alias Mapping mode value of Redirect which will force the browser to redirect to the primary alias. This is all done in the site settings area

    If you have the aliases configured this way it should avoid any confusion in links/menu items.