Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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" />
share|improve this answer
    
I have those present in my Wordpress installation and everything gets passed through. Haven't tried it for Joomla. – bugmagnet Dec 15 '11 at 12:02
up vote 0 down vote accepted

The best answer I got for this came from StackOverflow

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.