Search code examples
http-redirectiisurl-rewritingdotnetnuke

Redirect DNN Portal Alias to a Specific Page of the Portal


I need to redirect requests to the root of a specific Portal Alias of a DNN 07.03.02 install to a page of that same portal. The redirection can only effect one portal alias, another portal alias on the same portal must not redirect the same. Also, the DNN install that hosts this portal has many other portals so I cannot force redirection via a meta redirect file in the site's root. I configured an IIS (8.5) rewrite rule, such as below, which technically does the redirection I want, but this breaks the relative path to all images and stylesheets which are located in the portal's root directory. I've also tried DNN SiteURL redirection rules but those fail to force any redirection at all. If any has any suggestions of how I can configure such redirection for a DNN portal I'd greatly appreciate it.

        <rewrite>
        <rules>
            <rule name="my redirect" stopProcessing="true" enabled="false">
                <match url=".*" ignoreCase="true" />
        <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                    <add input="{HTTP_HOST}" pattern="^(www.)?mysite.com$" />
                </conditions>
    <action type="Rewrite" url="/newpage" appendQueryString="true" />
            </rule>
        </rules>
    </rewrite>

Solution

  • I corrected this issue by adding an exclusion to my IIS rewrite rule such as:

    <add input="{PATH_INFO}" pattern="^/portals/0/" negate="true" />
    

    so that the path to my portal's content would not be rewritten.