• Resolved roperjonathan

    (@roperjonathan)


    Hi there

    I already have one wordpress website that already exists in the root of my domain. However, I would also like to have another wordpress website (so another separate installation) in a subdirectory. This would mean that if you were to go on http://www.example.com it would show one WordPress website and if you went on http://www.example.com/wordpress, it would show the other WordPress site.

    My problem is that when I set up this second website, I have issues with the permalinks. I have used pretty permalinks with the %postname% parameter before on my other sites and in the root website. However, when I go to the permalinks page in the admin area, choose postname and press confirm, my whole subdirectory site crashes both the site itself and the admin area. It doesn’t seem to like the fact that my subdirectory website produces a web.config (not .htaccess) file. The only way I can get the subdirectory site working again is by deleting the web.config. My subdirectory site works fine when it is using the default links. Do I need to put something in the web.config file in the root to reference the site in the subdirectory?

Viewing 1 replies (of 1 total)
  • Thread Starter roperjonathan

    (@roperjonathan)

    I found a solution.

    The web.config in both sites can’t have the same rule name. If it does it errors. So to fix it change the rule name of one of your web.config

    Here is an example:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <system.webServer>
    <rewrite>
        <rules>
           <clear />
            <rule name="Some different name" stopProcessing="true">
                <match url=".*" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                </conditions>
                <action type="Rewrite" url="index.php" />
            </rule>
        </rules>
    </rewrite>
      </system.webServer>
    </configuration>

    You need to put in the clears as well to make sure you don’t get any 404 errors instead.

    Hope this helps someone.

Viewing 1 replies (of 1 total)
  • The topic ‘Permalinks in subdirectory’ is closed to new replies.