Anyone have a good guide to setup URL rewriting on IIS7?

Shaun Mason

Active member
I have been playing with using Full Friendly SEO names, but I'm not sure how to proceed.

Should I use purely URL Rewrite, or do I need to use a combination of the XenForo option and that?

Any advice would be appreciated.
 
I have been playing with using Full Friendly SEO names, but I'm not sure how to proceed.

Should I use purely URL Rewrite, or do I need to use a combination of the XenForo option and that?

Any advice would be appreciated.

Make sure the IIS rewrite module is installed. and copy paste this web.config in your root folder :

Code:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^.*$" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />
                    </conditions>
                    <action type="None" />
                </rule>
                <rule name="Imported Rule 2" stopProcessing="true">
                    <match url="^(data|js|styles|install)" />
                    <action type="None" />
                </rule>
                <rule name="Imported Rule 3" stopProcessing="true">
                    <match url="^.*$" />
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Then turn on the pretty URLs from the xenforo admin panel
 
Make sure the IIS rewrite module is installed. and copy paste this web.config in your root folder :

Code:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^.*$" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />
                    </conditions>
                    <action type="None" />
                </rule>
                <rule name="Imported Rule 2" stopProcessing="true">
                    <match url="^(data|js|styles|install)" />
                    <action type="None" />
                </rule>
                <rule name="Imported Rule 3" stopProcessing="true">
                    <match url="^.*$" />
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Then turn on the pretty URLs from the xenforo admin panel

Thanks you sir, that is helpful. I have to figure out how to merge these with my WordPress rewrite rules. I'm in the process of learning the URL Rewrite module better.
 
For some reason I was under the impression (misinformed) that the root folder took precedence. That certainly makes it easier.

The other way around :) the global web.config for your entire server then each domain then each folder ...

EDIT however each inherit properties from the one above ... if you do not specify the root folder for example in WP as..\ xenforo \..\wp\ you might have a problem.

I did not test anything on IIS yet ... I will as soon as I get the chance and give you the entire web.config with WP as a child application
 
Top Bottom