Showing posts with label URL Rewrite module. Show all posts
Showing posts with label URL Rewrite module. Show all posts

Monday, April 02, 2012

Part 2: URL-rewriting using IIS7, URL Rewrite, and your web.config file

1 comments
Previously, I wrote about how I used the .htaccess file and Apache mod_rewrite to translate SEO-friendly links back to their original formats for interpretation. Later, I also needed to do the same thing for an IIS7 server. I decided to use URL Rewrite which works with IIS7 and IIS7.5. For this to work, though, the URL Rewrite module needs to be installed on your server. Using URL Rewrite, you can create rewrite rules like with an .htaccess file but you'll be using your web.config file instead.

Problem: SEO-friendly link interpretation was needed on an IIS7 server, which doesn't have mod_rewrite.

Impact: The links are hard to read and remember and are not very good for SEO.

Solution:
The rewrite rules are actually somewhat similar with URL Rewrite. I just needed to move the parts around and in some cases change the syntax a little. In the previous example with mod_rewrite I wanted the following:

Re-interpret "http://www.example.com/a/256/my-title"

back into "http://www.example.com/index.php?page=a&id=256&title=my-title".