How To Run LiteCart on IIS

This article will guide you through how to install Microsoft Internet Information Services (IIS) and configure a new website running LiteCart. For this guide we assume that you have already installed PHP for Windows.

Install IIS

If your machine isn't running IIS yet, you will need to install it. This is usually done in the "Turn Windows features on or off" dialog.

  1. Click your Windows START-menu button.

  2. Type "Enable or disable Windows Features"

  3. Navigate to "Internet Information Services" and enable the following components:

    • World Wide Web Services -> Application Development Features -> "CGI"
    • World Wide Web Services -> Common HTTP Features -> Default Document
    • World Wide Web Services -> Common HTTP Features -> HTTP Errors
    • World Wide Web Services -> Common HTTP Features -> HTTP Redirection
    • World Wide Web Services -> Common HTTP Features -> Static Content
    • World Wide Web Services -> Performance Features -> Dynamic Content Compression
    • World Wide Web Services -> Security -> Request Filtering

windows_features_iis.png

  1. Click OK.

Create a local domain

If you intend to run this locally here is how we can create a new domain used for local access:

  1. Grab the Windows hosts file editor or open Notepad as an administrator and edit C:\Windows\System32\drivers\etc\hosts.

  2. Create a new hostname e.g. litecart.local and assign it to the local machine 127.0.0.1.

Configure IIS

  1. Open IIS manager by right clicking Windows START-menu and selecting Computer Management.

  2. Navigate to Services and Applications -> Internet Information Services.

  3. Select (Local Computer) in the tree and double-click "Default Document". Add "index.php" to the list

  4. Select (Local Computer) in the tree and double-click "MIME Types" and add extensions if missing:

    • .woff font/woff
    • .woff2 font/woff2
    • .webp image/webp

Setup a new IIS website

Rewritten URLs will turn /index.php/rubber-ducks-c-1/yellow-duck-p-1 into /rubber-ducks-c-1/yellow-duck-p-1. To enable this we need to make sure IIS has URL rewrite support installed and force enable detection in LiteCart.

  1. Open IIS manager by right clicking Windows START-menu and selecting Computer Management.

  2. Navigate to Services and Applications -> Internet Information Services.

  3. Expand (Local Computer)

  4. Expand "Sites".

  5. Right-click Sites and select New -> Web Site.

  6. Give this new site the name LiteCart and the domain we created litecart.local.

new_site_iis.png

  1. Select the new site "LiteCart" and Double-click Handler Mappings.

  2. Select Add Module Mapping to configure a handler for PHP files:

php_handler_iis.png

Enable Rewritten URLs

  1. Install the URL Rewrite Extension for IIS.

  2. Open IIS manager by right clicking Windows START-menu and selecting Computer Management.

  3. Navigate to Services and Applications -> Internet Information Services.

  4. In the Connections tree select (Local Computer) -> Sites -> LiteCart.

  5. Double-click "URL Rewrite" -> Add Rule(s) -> Blank rule and enter the following:

url_rewrite_iis.png

  1. Also under "URL Rewrite" click "View Server Variables" and add the following:

    MOD_REWRITE

  2. Install the add-on Force Rewritten URLs

Note

If you haven't already, install PHP Manager for IIS from here. Then you will see it in IIS Manager.

Revisions

Recently Edited Articles