views:

2582

answers:

3

I have Joomla 1.5.9 running on IIS7. I'm now experimenting with the SEO Settings from the Joomla global configuration page.

First I toyed with Search Engine Friendly URLs (that gets rid of the queries part of URLs); that works fine.

I also tried to enable the "Use Apache mod_rewrite". I installed "Microsoft URL Rewrite Module for IIS 7.0" and added the web.config as per http://learn.iis.net/page.aspx/527/joomla-on-iis . When clicking on menu links, this seems to work in that I no longer see index.php in the URL. The address bar updates to what appears like the right URL, but the content shown is always that of the home page. I tried both in IE and Google Chrome with the same result. Refreshing the page after loaded made no difference.

I tried re-starting IIS7, it didn't make a difference.

Edit: After I followed the suggestion below (followed instructions at http://www.mydotnetworld.com/post/2008/10/24/URL-Rewriting-In-Joomla-15-on-IIS-7.aspx :turned on fast cgi, modified php.ini, and imported rewrite rules instead of putting them in a web.config myself), I now get 404's instead of just showing the home page's content. The URL still appears to be correctly rewritten. So, different behavior but still doesn't work. I'm not sure this is useful information, but these two fields are shown in the 404 page: Requested URL http://localhost:80/joomla_course/seasonal-specialties Physical Path C:\inetpub\wwwroot\joomla_course\seasonal-specialties Should the physical path be the 'non-rewritten' URL? Or is it expected that that it be like this?

Edit 2: Oho! I found someone with the same issue posted on Joomla forums: http://forum.joomla.org/viewtopic.php?f=543&t=364706&p=1598137#p1598137 . No answer there either, though.

Any idea on how to diagnose (or even better, fix :) ) this?

Thanks!

A: 

It looks like there is something wrong with the rules in the web.config. Just going from a comment on the article you linked you are not the only one having this issue. I would remove the web.config and then follow the steps outlined here.

notandy
That looked promising, but it didn't work. Now I get 404's when I click on links. The url's still look right (as they did initially). The 404 says the physical path looks similar to the (rewritten) URL -- is that expected?
Jimmy
+1  A: 

I got this to work now. The key was to make sure FastCGI is used to run php (as per http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70 ), and making sure that the "Use Apache mod_rewrite" is enabled. If "Use Apache mod_rewrite" is turned off but the rewrite rules are present in IIS7, then the HTML shows up but none of the styling or images.

The requirement for using FastCGI is weird (and contradicts what is suggested in http://maximumpcguides.com/windows-vista/how-to-create-a-windows-vista-iis7-mysql-php-web-server , which is what I used to setup php in the first place). Everything seems to work when not using FastCGI, except for the URL rewriting.

It seems that either importing the rules (as suggested in http://www.mydotnetworld.com/post/2008/10/24/URL-Rewriting-In-Joomla-15-on-IIS-7.aspx) or manually adding them to a web.config file (as suggested in http://learn.iis.net/page.aspx/527/joomla-on-iis ) will work.

Jimmy
A: 

just run it on apache like normal people and itll work straightaway, why do people bother trying to hack things to run on windows ?

negativland
Because there are a lot of useful other things that IIS/Windows provides, and I don't want to re-learn to do stuff with Apache, etc. that I already know to do on IIS/Windows.
Jimmy