0

Context: IIS7, Win7, Joomla 1.5

With this URL, http://website/foo , if I have a subdirectory called "foo" in the root of the Joomla install, IIS7 tries to find index.php in it and returns a 403 before Joomla gets going.

With this URL, http://website/bar , if I don't have subdirectory called "bar", IIS7 passes the URL through to Joomla and lets it take care of whether the page exists or not.

In the event of http://website/foo , how do I set up IIS7 so that it ignores the fact that there's a "foo" subdirectory, and passes the full URL to Joomla?

2 Answers 2

1

As part of the installation of Joomla on IIS, you probably (or at least should) have created a web.config that looks similar to this:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Security Rule" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
          <conditions logicalGrouping="MatchAny">
            <add input="{QUERY_STRING}" pattern="mosConfig_[a-zA-Z_]{1,21}(=|\%3D)" ignoreCase="false" />
            <add input="{QUERY_STRING}" pattern="base64_encode.*\(.*\)" ignoreCase="false" />
            <add input="{QUERY_STRING}" pattern="(\&lt;|%3C).*script.*(\>|%3E)" />
            <add input="{QUERY_STRING}" pattern="GLOBALS(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" />
            <add input="{QUERY_STRING}" pattern="_REQUEST(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" />
          </conditions>
          <action type="CustomResponse" url="index.php" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
        </rule>
        <rule name="SEO Rule">
          <match url="(.*)" ignoreCase="false" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" pattern="" ignoreCase="false" />
            <add input="{URL}" negate="true" pattern="^/index.php" ignoreCase="false" />
            <add input="{URL}" pattern="(/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$" />
          </conditions>
          <action type="Rewrite" url="index.php" />
        </rule>
      </rules>
    </rewrite>
 </system.webServer>
</configuration>

To stop IIS from checking for existing files and directories before rewriting to Joomla, you should remove the following two lines:

    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" pattern="" ignoreCase="false" />
1
  • I have those present in my Wordpress installation and everything gets passed through. Haven't tried it for Joomla.
    – bugmagnet
    Dec 15, 2011 at 12:02
0

The best answer I got for this came from StackOverflow

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .