About The Author
Michael Flynn is a Senior Developer at Unicon, a consulting company that focuses on enterprise deployments of open source software. He specializes in web technologies that include C# .NET, SQL, XML, AJAX, jQuery, Flash, and also skills in Photoshop and Illustrator. He was been involved in web development since 1998, and earned a Bachelors and Masters degree in Computer Engineering and Computer Science from the Univerisity of Louisville and holds an MSCT certificate in Web Applications.
Calendar
<<  February 2012  >>
SMTWTFS
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910

URL Rewriting In Joomla 1.5 on IIS 7

I recently completed a project that needed to have Joomla use SEO friendly URL's on IIS 7.  The main goal was to get this to work with Microsoft URL Rewrite Module for IIS 7.0 Go Live. Doing some research I could not find any tutorials on this, or if anyone had succeeded.  Joomla is PHP based and Apache friendly and I am a .NET Developer so I hope you felt my pain through this learning process.  Joomla has built in SEF (Search Engine Friendly) functionality but works flawlessly on Apache, IIS on the other hand it is a different story.  Joomla uses the htaccess file if the website resides on an Apache server.  IIS doesn't use the htaccess file and therefore can not get the desired results we want.

Joomla Configuration

 

Default Joomla URL


http://www.mydotnetworld.com/index.php?option=com_content&task=view&id=5&Itemid=1

This disadvantage of this url is it is long, hard to read to the human eye, and not search engine friendly, meaning it might never be indexed.

SEF Joomla URL (htaccess disabled)

http://www.mydotnetworld.com/index.php/content/view/5/6/

To enable this you can log into the admin and navigate to Site > Global Configuration.  On the right side you will see a area called "SEO Settings".  Turn "Search Engine Friendly Urls" to on. 

The disadvantage to this approach is it had index.php in the url.  I have read somewhere that it doesn't hurt search engine indexing, which may be true, but if you can fix that for user display it is a must.

SEF Joomla URL (htaccess enabled)

http://www.mydotnetworld.com/content/view/5/6/

If you want to remove the index.php from the URL and you are on Apache you may select the second option under "SEO Settings".  Ignore the warning by "Use Apache mod_rewrite" and turn it on.  I haven't tested this on Apache but it seems to remove the index.php mysteriously as I do not have much knowledge of PHP and how Joomla removes this.  IIS does not have the ability to read the htaccess file, and rewrite rules in it.

SEF Joomla URL with SH404SEF (htaccess enabled)

http://www.mydotnetworld.com/philosophy/marketing/web-strategy

I tried numerous plugins but could not get the desired result I wanted.  The one I finally got working was SH404SEF.  As you can see the above url is much cleaner and easier to read.  This result was accomplished from the above steps.  Yes, even turning on the htaccess option.  When installing this plugin make sure it is enabled.

The last step is to enable the actual rewriting of the page to the correct URL.  I copied the rules from the htaccess file provided by Joomla.  The bold one I could not import into IIS as it could not read the syntax, but works regardless of this rule.  So if anyone has a work around please add a comment.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]


IIS 7 Configuration



I know there are ISASPI filter work around's available but I wanted to see if I could get this to work with the new plugin available for IIS, called Microsoft URL Rewrite Module for IIS 7.0 Go Live

You will need to install the Microsoft URL Rewrite Module for IIS 7.0 Go Live and FastCgi.  Go to your website directory in IIS and make sure you are in features view.  Double click the "URL Rewrite" icon under the IIS section.



Once in the url rewrite section there is an option to "Import rules..." on the sidebar.



Within the textbox that says "Rewrite rules", paste the rules from above that were taken from the htaccess file found in the Joomla base directory. Click apply.  IIS is now set to do URL rewriting for Joomla.



After much searching and reading this is the configuration I came up with to get Joomla to have SEO friendly URL's on IIS 7 and the Go Live Rewrite Module.

Posted on 10/24/2008 1:50:00 AM by cblaze22

Permalink | Comments (39) | Post RSSRSS comment feed |

Categories: Url Rewriting | Joomla | IIS

Tags: , ,

Currently rated 3.7 by 3 people

  • Currently 3.666667/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5