Setting up Joomla on Microsoft IIS

How to Transfer a Joomla Website From a Linux Server to a Windows Server

Ah, the joys of Windows.

If you’re like most Joomla Developers, you’ll probably never have to touch a Window server or even recognise the term “IIS”.  Say what?

Exactly.

Microsoft is rather a different beast from our beloved Linux, and every once in a while you may be faced with a client on Windows hosting and will therefore be forced to tame and pander to the whims of Mr Gates’ legacy.

This tutorial will lead you around the pitfalls to the golden gates of success.

So let’s get started.

  1. Copy your Joomla website files (on your Linux hosting) and transfer them via FTP to your Windows hosting.
  2. Export your database via PHPMyAdmin (on your Linux hosting), and import via PHPMyAdmin on your new Windows hosting.
  3. Make sure your hosting provider has either IIS URL Rewrite Module (for IIS 7 and is free to download and install on your IIS7 webserver), or ISAPI_Rewrite (or a similar third-party add-on).
  4. Ensure that the IIS URL Rewrite Module is looking for your .htaccess file (yes, you read that right.  .htaccess on a Windows server can play nice if you’ve got the IIS URL Rewrite Module or similar, in place).  If your IIS URL Rewrite Module is expecting your .htaccess file to be called something else, be sure to rename your .htaccess file accordingly to match.
  5. Make sure the $live_site entry in your configuration.php is completed with your website URL (remember to add the trailing slash):
    • var $live_site = ‘http://www.webholism.com/’;
  6. Open the index.php file in your Joomla root (the main Joomla folder), and add the below lines just after the opening <?php tag

if (isset($_SERVER[‘HTTP_X_REWRITE_URL’]))
{
$_SERVER[‘REQUEST_URI’] = $_SERVER[‘HTTP_X_REWRITE_URL’];
}

 

If you’re using SH404SEF, you may need to have the following settings:

  1. Site -> Global Configuration -> Site tab:
    • Search Engine Friendly URLs = Yes
    • Use URL rewriting = Yes
    • Other options in this area = No
  2. Components -> Sh404SEF -> Control Panel
    • Enable URL optimization = Yes
    • Rewriting mode =  With .htaccess (mod_rewrite)
    • Activate security functions = Yes

If you’re using an alternative SEF extension, you may need to follow their setup procedure.

 

To remove index.php from the SEF URL’s, Windows needs a little help to do this.

  1. Open your web.config file (should be in your Joomla root folder).
  2. Paste the following code below the opening <system.webServer> tag:

<rewrite>
<rules>
<rule name=”Redirect index.php” stopProcessing=”true”>
<match url=”index\.php/(.*)” />
<action type=”Redirect” url=”{R:1}” appendQueryString=”false” />
</rule>
<rule name=”Rewrite index.php”>
<match url=”(.*)” />
<conditions>
<add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” />
<add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true” />
</conditions>
<action type=”Rewrite” url=”index.php/{R:1}” />
</rule>
</rules>
</rewrite>

 

You should now be pretty much sorted for SEF URL’s.  Hurrah, you clever thing you!

 

Excellent additional resources for setting up Joomla on a Windows server:

  1. http://docs.joomla.org/IIS
  2. http://docs.joomla.org/Enabling_Search_Engine_Friendly_(SEF)_URLs_on_IIS
  3. http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/translate-htaccess-content-to-iis-webconfig
This entry was posted in Joomla 2.5, Website on by .

About Sara Thornton

Sara is a Jack (or Jill) of many trades. A web designer and developer, an ethical SEO implementer, an AdWords advocate, as well as being our in house user-guide creator and trainer. In her spare time she loves a bendy/stretchy yoga session, and feels most happy when she's near the ocean (ideally with a ridiculously absorbing book).

Leave a Reply

Your email address will not be published. Required fields are marked *