Administrator Account posted on January 04, 2012 20:18
The DotNetNuke (DNN) open source CMS platform has improved considerably over the last few years and offers a great deal of functionality for the cost. However, there may be times you want to include a page in your website that does not have to fit within the DNN skin you’re using. Typically this happens when you need to add a sales page from an external source. It may be simple HTML code, or it could even be PHP based programming code. For those people already familiar with DNN, these pages are incompatible with the ASP.Net environment of DNN.
Fortunately there are ways to work around the DNN “shell” environment to include these special pages without having to redesign them or include them using the DNN iFrame module. Basically this involves adding entries to a new web.config file on your website.
The web.config file in a Microsoft ASP.Net website (this is the environment used by DNN) contains technical configuration details on how the website should run. By default, the DNN installation puts their version required of the web.config file in your root folder of your website. You should never change this without understanding what it does; else the operation of your website could be corrupted. If you do need to change it, then make a backup copy first. However, for what we want to accomplish we do not need to change this one.
For the purposes of including a non-DNN page in your website there is a lesser-known feature of the web.config where the default values in the root folder can be overridden using a different copy of the web.config in a separate subfolder on your website. This is what we will be using.
- Create a subfolder on the website where you want to host the external page e.g. “social-media”.

- Create a new web.config file in this newly created folder with the following contents:
<configuration>
<system.web>
<httpHandlers>
<clear />
</httpHandlers>
</system.web>
</configuration>
- Copy the files needed for this page (using FTP upload) into this new folder. Keep in mind that none of the DNN features, including role-based permission security, will be available for you to use.
- If the external page is PHP based, make sure you have PHP installed on your IIS runtime environment (most Windows Hosting providers have this enabled). If your PHP page requires an .htaccess file with mod_rewrite rules, you will need to make use of the IIS Importing Apache mod_rewrite Rules feature. For most Apache mod_rewrite rules this will convert them to the equivalent IIS rewrite. Only later versions of IIS have this function, so you will need to verify this with your hosting provider first. If you have access to your own IIS admin module, then you may need to install it first using the link provided in the above article.
If you don’t have access to IIS admin on your shared hosting plan, then you can use the IIS admin console on your local Windows 7 PC. When you import a mod_rewrite rule using this tool, it writes the configuration out to the web.config folder on your PC. So once created on your local PC, you can simply copy the new entries created in the web.config to the newly created web.config in your new website’s subfolder. Make sure that you do not put these new config entries in the root folder, as it may interfere with the proper operation of DNN.
.htaccess file rewrite rule:
RewriteEngine on
RewriteRule ^(.*)$ index.php?page=$1 [QSA]
Converted rewrite rule for IIS Web.config
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1">
<match url="^(.*)$" ignoreCase="false" />
<action type="Rewrite" url="index.php?page={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
- If the default file for this subfolder should be something other than Default.aspx (such as index.php or index.html), then you need to add entries to your new subfolder’s web.config similar to the following:
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="Index.php" />
<add value="Default.aspx" />
<add value="Index.html" />
<add value="Index.htm" />
<add value="Index.cfm" />
<add value="Index.shtml" />
<add value="Index.shtm" />
<add value="Index.stm" />
<add value="Index.php3" />
<add value="Index.asp" />
<add value="Index.aspx" />
<add value="Default.htm" />
<add value="Default.asp" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
- Add a new DNN menu option/link to your new DNN external page. In the page settings you'll need to change an option in the "Advanced Settings" under "Other Settings" to specify this page as linking to an external URL. Enter the full URL for your non-DNN web page as shown below:

- That’s it! See an example here:
Social Media for Part Time Internet Marketers