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

Discussion in 'XenForo Questions and Support' started by Shaun Mason, Oct 18, 2010.

  1. Shaun Mason

    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.
     
  2. Blandt

    Blandt Well-Known Member

    Have you tried the import tool ?
     
  3. Blandt

    Blandt Well-Known Member

    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. Shaun Mason

    Shaun Mason Active Member

    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.
     
  5. Blandt

    Blandt Well-Known Member

    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 :)
     
  6. Shaun Mason

    Shaun Mason Active Member

    For some reason I was under the impression (misinformed) that the root folder took precedence. That certainly makes it easier.
     
    Blandt likes this.
  7. Blandt

    Blandt Well-Known Member

    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
     
  8. Shaun Mason

    Shaun Mason Active Member

    That is perfect BTW.

    As a Windows developer I am a bit ashamed to admit I have no idea how that functionally works.
     
  9. Shaun Mason

    Shaun Mason Active Member

    Yes, I imported everything from my vBulletin install, it took a while though.

    forums.traditionsportsonline.com if you are interested.
     
  10. Blandt

    Blandt Well-Known Member

    Make sure you have the rewrite module installed before anything otherwise IIS will go haywire

    If you don't have it installed it go here http://www.iis.net/download/URLRewrite

    select your OS architecture install and done!
     
  11. Blandt

    Blandt Well-Known Member

    haha brand new stuff. Microsoft spat everything out in less than a year. I just gave up for awhile, it was just too much :D
     
  12. Blandt

    Blandt Well-Known Member

    And please my edit above
     
  13. Shaun Mason

    Shaun Mason Active Member

    Noted :)
     

Share This Page