Many hosting providers do not allow you to install your web application into your hosting account's root path. However, you can overcome this limitation by several ways. Specifying a host header in web.config and modifying Portal Alias table is one of the useful methods.
Although it can be a good workaround, using host header in
DotNetNuke has its own limitation with SEO Friendly URLs. If you are in a rush, you can see the logged issue here
>>
I had some time to test
DotNetNuke 5.6.2 release against the goal of
removing sub directory name from URL, i was able to do it. But, URL structure where Human Friendly (SEO Friendly URLs) used, gave 404 errors.
For instance, if you install your website in a folder called portal, your host header value should be following as demonstrated in DotNetNuke Wiki.
<add key="HostHeader" value="portal/" />
After using this and adding a naked portal alias into Portal Alias table for desired domain, you will be able to access your website. Partly!
Login, Registration and some of Host pages will work, while others won't!
So, the only way to overcome this problem is to remove
urlFormat="humanfriendly" from following section in web.config.
<add name="DNNFriendlyUrl" type="DotNetNuke.Services.Url.FriendlyUrl.DNNFriendlyUrlProvider, DotNetNuke.HttpModules" includePageName="true" regexMatch="[^a-zA-Z0-9 _-]" urlFormat="humanfriendly" />
After using this workaround, you will be able to access the pages in your website with no subfoldername in urls. However, you will have no benefit of using
SEO Friendly URLs.
Maybe it's by design, or a bug in core needs to get fixed. Issue is logged below:
Human Friendly URL's With Host Header in web.config
If interested in solution, you can click on Watch button at bottom left corner.