Project: ocPortal
Code Location: git://github.com/chrisgraham/ocPortal.gitmaster
Browse
/
Download File
web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
	<system.webServer>
		<rewrite>
			<rules>
				<!--# Redirect away from modules called directly by URL. Helpful as it allows you to "run" a module file in a debugger and still see it running.-->
				<rule name="Imported Rule 1" stopProcessing="true">
					<match url="^([^=]*)webdav.php/([^=]*)pages/(modules|modules_custom)/([^/]*)\.php$" ignoreCase="false" />
					<action type="None" />
				</rule>
				<rule name="Imported Rule 2" stopProcessing="true">
					<match url="^([^=]*)pages/(modules|modules_custom)/([^/]*)\.php$" ignoreCase="false" />
					<action type="Redirect" redirectType="Found" url="{R:1}index.php\?page={R:3}" appendQueryString="true" />
				</rule>

				<!--# These have a specially reduced form (no need to make it too explicit that these are CEDI)-->
				<!--#	We shouldn't shorten them too much, or the actual zone or base url might conflict-->
				<rule name="Imported Rule 3" stopProcessing="true">
					<match url="^([^=]*)pg/s/([^\&amp;\?]*)/index\.php$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?page=cedi&amp;id={R:2}" appendQueryString="true" />
				</rule>

				<!--# These have a specially reduce form (wide is implied)-->
				<rule name="Imported Rule 4" stopProcessing="true">
					<match url="^([^=]*)pg/galleries/image/([^\&amp;\?]*)/index\.php(.*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?page=galleries&amp;type=image&amp;id={R:2}&amp;wide=1{R:3}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 5" stopProcessing="true">
					<match url="^([^=]*)pg/galleries/video/([^\&amp;\?]*)/index\.php(.*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?page=galleries&amp;type=video&amp;id={R:2}&amp;wide=1{R:3}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 6" stopProcessing="true">
					<match url="^([^=]*)pg/iotds/view/([^\&amp;\?]*)/index\.php(.*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?page=iotds&amp;type=view&amp;id={R:2}&amp;wide=1{R:3}" appendQueryString="true" />
				</rule>

				<!--# These are standard patterns-->
				<rule name="Imported Rule 7" stopProcessing="true">
					<match url="^([^=]*)pg/([^/\&amp;\?]*)/([^/\&amp;\?]*)/([^\&amp;\?]*)/index\.php(.*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?page={R:2}&amp;type={R:3}&amp;id={R:4}{R:5}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 8" stopProcessing="true">
					<match url="^([^=]*)pg/([^/\&amp;\?]*)/([^/\&amp;\?]*)/index\.php(.*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?page={R:2}&amp;type={R:3}{R:4}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 9" stopProcessing="true">
					<match url="^([^=]*)pg/([^/\&amp;\?]*)/index\.php(.*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?page={R:2}{R:3}" appendQueryString="true" />
				</rule>
				<!--# This one is weird... apache strips out // and turns to /, thus requiring an extra pattern...-->
				<rule name="Imported Rule 10" stopProcessing="true">
					<match url="^([^=]*)pg/index\.php(.*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?page={R:3}" appendQueryString="true" />
				</rule>

				<!--# Now the same, but without any additional parameters (and thus no index.php)-->
				<rule name="Imported Rule 11" stopProcessing="true">
					<match url="^([^=]*)pg/s/([^\&amp;\?]*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?page=cedi&amp;id={R:2}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 12" stopProcessing="true">
					<match url="^([^=]*)pg/galleries/image/([^\&amp;\?]*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?page=galleries&amp;type=image&amp;id={R:2}&amp;wide=1{R:3}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 13" stopProcessing="true">
					<match url="^([^=]*)pg/galleries/video/([^\&amp;\?]*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?page=galleries&amp;type=video&amp;id={R:2}&amp;wide=1{R:3}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 14" stopProcessing="true">
					<match url="^([^=]*)pg/iotds/view/([^\&amp;\?]*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?page=iotds&amp;type=view&amp;id={R:2}&amp;wide=1" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 15" stopProcessing="true">
					<match url="^([^=]*)pg/([^/\&amp;\?]*)/([^/\&amp;\?]*)/([^\&amp;\?]*)/$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?page={R:2}&amp;type={R:3}&amp;id={R:4}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 16" stopProcessing="true">
					<match url="^([^=]*)pg/([^/\&amp;\?]*)/([^/\&amp;\?]*)/([^\&amp;\?]*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?page={R:2}&amp;type={R:3}&amp;id={R:4}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 17" stopProcessing="true">
					<match url="^([^=]*)pg/([^/\&amp;\?]*)/([^/\&amp;\?]*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?page={R:2}&amp;type={R:3}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 18" stopProcessing="true">
					<match url="^([^=]*)pg/([^/\&amp;\?]*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?page={R:2}" appendQueryString="true" />
				</rule>

				<!--# And these for those nasty situations where index.php was missing and we couldn't do anything about it (usually due to keep_session creeping into a semi-cached URL)-->
				<rule name="Imported Rule 19" stopProcessing="true">
					<match url="^([^=]*)pg/s/([^\&amp;\?\.]*)&amp;(.*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?{R:3}&amp;page=cedi&amp;id={R:2}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 20" stopProcessing="true">
					<match url="^([^=]*)pg/galleries/image/([^/\&amp;\?\.]*)&amp;(.*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?{R:5}&amp;page=galleries&amp;type=image&amp;id={R:2}&amp;wide=1&amp;{R:3}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 21" stopProcessing="true">
					<match url="^([^=]*)pg/galleries/video/([^/\&amp;\?\.]*)&amp;(.*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?{R:5}&amp;page=galleries&amp;type=video&amp;id={R:2}&amp;wide=1&amp;{R:3}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 22" stopProcessing="true">
					<match url="^([^=]*)pg/iotds/view/([^/\&amp;\?\.]*)&amp;(.*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?{R:3}&amp;page=iotds&amp;type=view&amp;id={R:2}&amp;wide=1" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 23" stopProcessing="true">
					<match url="^([^=]*)pg/([^/\&amp;\?\.]*)/([^/\&amp;\?\.]*)/([^/\&amp;\?\.]*)&amp;(.*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?{R:5}&amp;page={R:2}&amp;type={R:3}&amp;id={R:4}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 24" stopProcessing="true">
					<match url="^([^=]*)pg/([^/\&amp;\?\.]*)/([^/\&amp;\?\.]*)&amp;(.*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?{R:4}&amp;page={R:2}&amp;type={R:3}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 25" stopProcessing="true">
					<match url="^([^=]*)pg/([^/\&amp;\?\.]*)&amp;(.*)$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}index.php\?{R:3}&amp;page={R:2}" appendQueryString="true" />
				</rule>

				<!--# These have a specially reduced form (no need to make it too explicit that these are CEDI)-->
				<!--#	We shouldn't shorten them too much, or the actual zone or base url might conflict-->
				<rule name="Imported Rule 26" stopProcessing="true">
					<match url="^(site|forum|adminzone|cms|personalzone|collaboration)/s/([^\&amp;\?]*)\.htm(\?.*)?$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}/index.php\?page=cedi&amp;id={R:2}&amp;{R:3}" appendQueryString="true" />
				</rule>

				<!--# These have a specially reduce form (wide is implied)-->
				<rule name="Imported Rule 27" stopProcessing="true">
					<match url="^(site|forum|adminzone|cms|personalzone|collaboration)/galleries/image/([^\&amp;\?]*)\.htm(\?.*)?$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}/index.php\?page=galleries&amp;type=image&amp;id={R:2}&amp;wide=1&amp;{R:3}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 28" stopProcessing="true">
					<match url="^(site|forum|adminzone|cms|personalzone|collaboration)/galleries/video/([^\&amp;\?]*)\.htm(\?.*)?$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}/index.php\?page=galleries&amp;type=video&amp;id={R:2}&amp;wide=1&amp;{R:3}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 29" stopProcessing="true">
					<match url="^(site|forum|adminzone|cms|personalzone|collaboration)/iotds/view/([^\&amp;\?]*)\.htm(\?.*)?$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}/index.php\?page=iotds&amp;type=view&amp;id={R:2}&amp;wide=1{R:3}" appendQueryString="true" />
				</rule>

				<!--# These are standard patterns-->
				<rule name="Imported Rule 30" stopProcessing="true">
					<match url="^(site|forum|adminzone|cms|personalzone|collaboration)/([^/\&amp;\?]+)/([^/\&amp;\?]*)/([^\&amp;\?]*)\.htm(\?.*)?$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}/index.php\?page={R:2}&amp;type={R:3}&amp;id={R:4}&amp;{R:5}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 31" stopProcessing="true">
					<match url="^(site|forum|adminzone|cms|personalzone|collaboration)/([^/\&amp;\?]+)/([^/\&amp;\?]*)\.htm(\?.*)?$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}/index.php\?page={R:2}&amp;type={R:3}&amp;{R:4}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 32" stopProcessing="true">
					<match url="^(site|forum|adminzone|cms|personalzone|collaboration)/([^/\&amp;\?]+)\.htm(\?.*)?$" ignoreCase="false" />
					<action type="Rewrite" url="{R:1}/index.php\?page={R:2}&amp;{R:3}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 33" stopProcessing="true">
					<match url="^([^/\&amp;\?]+)/([^/\&amp;\?]*)/([^\&amp;\?]*)\.htm(\?.*)?$" ignoreCase="false" />
					<action type="Rewrite" url="index.php\?page={R:1}&amp;type={R:2}&amp;id={R:3}&amp;{R:4}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 34" stopProcessing="true">
					<match url="^([^/\&amp;\?]+)/([^/\&amp;\?]*)\.htm(\?.*)?$" ignoreCase="false" />
					<action type="Rewrite" url="index.php\?page={R:1}&amp;type={R:2}&amp;{R:3}" appendQueryString="true" />
				</rule>
				<rule name="Imported Rule 35" stopProcessing="true">
					<match url="^([^/\&amp;\?]+)\.htm(\?.*)?$" ignoreCase="false" />
					<action type="Rewrite" url="index.php\?page={R:1}&amp;{R:2}" appendQueryString="true" />
				</rule>
			</rules>
		</rewrite>

		<defaultDocument>
			<files>
				<clear />
				<add value="index.html" /> 
				<add value="index.php" />
			</files>
		</defaultDocument>

		<!-- HTTP Errors section should only be enabled if the "Error Pages"
		feature has been delegated as "Read/Write" at the Web Server level.
		 <httpErrors>
				 <remove statusCode="404" subStatusCode="-1" />
				 <error statusCode="404" prefixLanguageFilePath="" path="/index.php?page=404" responseMode="ExecuteURL" />
		 </httpErrors>
		-->
	</system.webServer>
</configuration>