Showing posts with label IIS. Show all posts
Showing posts with label IIS. Show all posts

Thursday, April 8, 2010

URL Rewrite very slow on IIS7

My friend has an ASP shopping cart running on Windows 2008 Server + IIS7 + SQL Server. This cart does not support SEO / user friendly URLs and apparently due to that, his site was getting very low rankings on the search engines. He called me in to help him out implement URL Rewriting to resolve this. Here is my experience with this problem and finally how I went about resolving this.

So the first step was to install the URL Rewrite Module 2.0 for IIS. Next was to configure the rewriting of the URLs - the cart produced URLs of the form store/listItems.asp?cat=123&item=456. The item id number and the corresponding category id number changed for different items so putting in a generic regular expression would not work. So we would need to create static rewrite maps to achieve our goal.

So I created a rewrite map with entries like /store/listItems.asp?cat=123&item=456 mapped to /Item1 and /store/listItems.asp?cat=123&item=457 mapped to /Item2 and so on. This worked but the page did not come up properly. Investigation revealed that this was due to the HTML having relative URLs for CSS, Image & JavaScript files. I changed paths to absolute paths and lo-behold it was working fine! However, when using the user-friendly URL, the pages would come up quite slow compared to the page display using the old URLs.

In fact the pages came up so slow that we had to scrap this idea and look for other alternatives. Finally, after a lot of investigation, we fixed on the ages-old method of creating static HTML index files in folders named by each category. The header, footer & navigation menus would be common and kept in common folder. I know that this is not such a good idea and will result in creation of hundreds of folders with only an index file. But what the heck - it is simple, it works and it gets the job done!

Monday, March 22, 2010

Install WordPress on IIS7

A friend of mine wanted me help him install WordPress on his website - no big deal as WP is famous for it's 5 minute installs and so I figured this should be a cake walk for me. Little did I know that my friend's web-server was IIS7 on Windows Server 2008 and this would translate to a 5 hour install :(

Google, pointed me to a very good site that helped me out - trainsignaltraining.com.

Here are the components that you need to download:

Here are the Installation steps:
  1. Install & configure PHP
  2. Install & configure MySQL
  3. Install & configure PHPMyAdmin
  4. Install & configure URL Rewrite Extension
  5. Install & configure WordPress
  6. Configure Search Engine Friendly URLs on WordPress

However, here are a few "gotchas" that need to be taken care of:
  • For PHPMyAdmin to work, you may need to change in config.inc.php
    $cfg[$i]['host'] = ‘localhost’; to
    $cfg[$i]['host'] = ‘127.0.01’; or
    $cfg['Servers'][$i]['host'] = ‘127.0.0.1′
  • For PHPMyAdmin to work, you may need to change in config.inc.php
    controluser = ‘pma’ to
    controluser = ‘root’
  • For PHPMyAdmin to work, you may need to change windows\system32\drivers\etc\hosts file:
    Remove the comment (#) in front of the line 127.0.0.1
    Comment out the line ::1 localhost
  • Read the comments in all the pages as they have solutions to a lot of common problems

Note: I am assuming that IIS7 is already installed. If not, then there's a good tutorial for that as well here!

LinkWithin

Related Posts Plugin for WordPress, Blogger...