• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

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

#1
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.
 

Blandt

Well-known member
#3
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
 
#4
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.
 

Blandt

Well-known member
#5
Just drop this web.config at xenforo root folder, and WP gets its own web.config at the root folder too. you do not need to merge them :)
 

Blandt

Well-known member
#7
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