This configuration assumes that you have xenforo nested inside Wordpress in a folder named community : (please edit)
c:\www\domain\wordpress\community so the URL is like so : www.domain.com ----> Wordpress
and www.domain.com/community ------> Xenforo
So the idea is to set an application inside Wordpress to point to xenforo and we need 2 web.config files. the first located at the root of Wordpress and the second at the root of xenforo.
Here we go:
This is the Wordpress web.config : and please note that I have added a canonical rule to redirect domain.com to www.domain.com If you don't want it please remove that one rule. And also have setup support@domain.com to use your local SMTP server (again edit as appropriate)
This is Xenforo web.config .. and it goes in the community folder within Wordpress where xenforo files are located :
Ok that's it
... Let me know if you need any special setup ... oh and make sure you have the URL rewrite module installed
c:\www\domain\wordpress\community so the URL is like so : www.domain.com ----> Wordpress
and www.domain.com/community ------> Xenforo
So the idea is to set an application inside Wordpress to point to xenforo and we need 2 web.config files. the first located at the root of Wordpress and the second at the root of xenforo.
Here we go:
This is the Wordpress web.config : and please note that I have added a canonical rule to redirect domain.com to www.domain.com If you don't want it please remove that one rule. And also have setup support@domain.com to use your local SMTP server (again edit as appropriate)
Code:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.php" />
</files>
</defaultDocument>
<rewrite>
<rules>
<rule name="CanonicalHostNameRule1">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www\.domain\.com$" negate="true" />
</conditions>
<action type="Redirect" url="http://www.domain.com/{R:1}" />
</rule>
<rule name="WordPress Rule" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" />
</rule>
</rules>
<outboundRules>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
</system.webServer>
<system.net>
<mailSettings>
<smtp from="support@domain.com">
<network host="localhost" />
</smtp>
</mailSettings>
</system.net>
</configuration>
This is Xenforo web.config .. and it goes in the community folder within Wordpress where xenforo files are located :
Code:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="CanonicalHostNameRule1">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="^www\.domain\.com$" negate="true" />
</conditions>
<action type="Redirect" url="http://www.domain.com/{R:1}" />
</rule>
<rule name="XenForo Rule 1" stopProcessing="true">
<match url="^.*$" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />
</conditions>
<action type="None" />
</rule>
<rule name="XenForo Rule 2" stopProcessing="true">
<match url="^(data|js|styles|install)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="None" />
</rule>
<rule name="Xenforo Rule 3" stopProcessing="true">
<match url="^.*$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="index.php" />
</rule>
<rule name="Xenforo Rule 4" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Ok that's it
