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!

3 comments:

MapMan said...

Thank heavens for Apache/PHP/Javascript/Python. I never have to look back again...

Darshan Shah said...

True, thanks to LAMP - our lives are simpler and much better!

phillip said...

Every since we move from IIS6 to IIS7 and implemented the SEO rewrite, the quadcore with 8Gig Ram still couldn't deliver a simple website. We have to reset the server every day to get the site running.

If you know how to resolve this problem, i would be happy to hire you as a consultant.

contact me via phillipn@digitalmarketingsolutions.com

Thanks.

LinkWithin

Related Posts Plugin for WordPress, Blogger...