Hello,
I have Joomla 1.5.9 running with php 5.2.8, mySQL 5.1.31 on IIS7 on a vista 64 dev box. I have both SEO Settings "Search Engine Friendly URLs" and "Use Apache mod_rewrite" working correctly.
I'm also setting up a hosted site (with www.mochahosting.com). They use slightly older versions of the same software: Joomla 1.5.5, php 5.2.6, mySQL 5.0.4x. They also use IIS7, but running on Windows 32.
I can't get either of the SEO settings to work on the hosted site (I have gotten the SEO settings to work on my local machine, with pretty much the same configuration). Let's start with "Search Engine Friendly URLs" only to keep things simple.
Also, I don't yet have a domain name, so I use a hosts file alias to get to the site. I don't expect anyone to go through that trouble to answer my question, so I'll just describe the issue and hope I do a good enough job that people can understand what's going on. I'll use http://nodomainyet.com/joomla156_mx as the base URL (i.e., the joomla home page) for the purpose of this question. Yes, this does imply that Joomla is installed in a subdirectory -- I'm not sure if this is a problem or not (it's not a problem on my dev box).
On to the problem.
Turning on "Search Engine Friendly URLs" causes http://nodomainyet.com/joomla156_mx to generate a 404 ("Component not found"). In the 404 error page there is a link that goes to http://nodomainyet.com/joomla156_mx/index.php -- and that link works. If I turn off "Search Engine Friendly URLs" then both http://nodomainyet.com/joomla156_mx and http://nodomainyet.com/joomla156_mx/index.php work. So it seems that turning on "Search Engine Friendly URLs" causes the "automatic redirecting" of http://nodomainyet.com/joomla156_mx to http://nodomainyet.com/joomla156_mx/index.php to stop working...
Now, if I go to http://nodomainyet.com/joomla156_mx/index.php and from there navigate to the various main menu links (I'm only using the default joomla site that gets installed with a new Joomla instance), then everything works fine. It's just going to http://nodomainyet.com/joomla156_mx that doesn't work. It's worth noting that the "home" link that's in the main menu goes to http://nodomainyet.com/joomla156_mx by default.
I've compared the output of phpinfo on the host to that of my dev box and couldn't see any differences that would cause this issue...
Turning on the second SEO setting -- "Use Apache mod_rewrite" -- does not solve the problem (one would think that it might, since the purpose of that setting is to get rid of index.php in the URL).
The "Search Engine Friendly URLs" usually seems pretty trivial to get to work -- it doesn't require a web.config and rewrite rules... I'm not sure what could possibly cause it to go wrong.
Update - 2009-03-03
I thought maybe it was a bad idea to only turn on the first SEO setting ("Search Engine Friendly URLs") from ("Use Apache mod_rewrite") (even though I can just turn on "Search Engine Friendly URLs" by itself on my local machine and it works fine). So I tried a few more experiments
I thought perhaps the problem was that URL rewriting wasn't setup properly in IIS7 on the host. I did the (first) test file described in http://learn.iis.net/page.aspx/461/creating-rewrite-rules-for-the-url-rewrite-module and that worked -- so that means URL rewriting is working.
Then I thought perhaps the problem is that the rewrite rules that one sees everywhere for Joomla on IIS7 need to be rewritten to take into account the subdirectory. Like I said above, the SEO settings are working fine on my local machine. Joomla is also installed in a subdirectory, and everything is working fine. Nevertheless, I tried to modify the rewrite rule from
<rewrite>
<rules>
<rule name="Imported Rule 1" enabled="true">
<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="{SCRIPT_NAME}" negate="true" pattern="^/index.php" ignoreCase="false" />
<add input="{SCRIPT_NAME}" pattern="(/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
to
<rewrite>
<rules>
<rule name="Imported Rule 1" enabled="true">
<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="{SCRIPT_NAME}" negate="true" pattern="^/joomla156mx/index.php" ignoreCase="false" />
<add input="{SCRIPT_NAME}" pattern="(/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$" />
</conditions>
<action type="Rewrite" url="joomla156mx/index.php" />
</rule>
</rules>
</rewrite>
(i.e., prepending the directory name to the condition and action). That didn't make a difference. Now, I'm completely new to rewrite rules so I might have screwed up something.
I guess I find it kind of suspicious that there is no redirect rule; meaning if I copy & paste a 're-written' URL, does't something have to tell the server that is a made-up URL, and it should be redirected to a real URL? But, again, this is all working fine on my local box with plain old rewrite rules, so I may be barking at the wrong tree.
Thanks for the help!