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".
Showing posts with label SEO. Show all posts
Showing posts with label SEO. Show all posts
Monday, April 02, 2012
Part 2: URL-rewriting using IIS7, URL Rewrite, and your web.config file
Posted by
J Kommala
at
4/02/2012 11:18:00 pm
Labels:
IIS,
SEO,
URL Rewrite module,
URL rewriting,
web.config
1 comments
Part 1: SEO-friendly links using .htaccess and PHP
Posted by
J Kommala
at
4/02/2012 10:38:00 pm
Labels:
.htaccess,
mod_rewrite,
PHP,
SEO,
URL rewriting
0
comments
A few weeks ago, I decided to try out some URL rewriting to use for some SEO-friendly links. I decided upon using Apache's mod_rewrite in an .htaccess file since I was developing using PHP on Apache. I wanted to be able to use SEO-friendly links on my website. In my solution, the key was using the .htaccess file to rewrite SEO-friendly links in the background back to the ugly URLs and using PHP to write the URLs to the SEO-friendly version for users and the browser to see.
Problem: I needed a way to convert my URLs to SEO-friendly versions.
Impact: The links are hard to remember and not very good for SEO.
Solution:
I used mod_rewrite and an .htaccess file to re-interpret SEO-friendly links back to their original formats.
As an example, the original format was something like:
http://www.example.com/index.php?page=a&id=256&title=my-title
The desired SEO-friendly format is:
http://www.example.com/a/256/my-title
Problem: I needed a way to convert my URLs to SEO-friendly versions.
Impact: The links are hard to remember and not very good for SEO.
Solution:
I used mod_rewrite and an .htaccess file to re-interpret SEO-friendly links back to their original formats.
As an example, the original format was something like:
http://www.example.com/index.php?page=a&id=256&title=my-title
The desired SEO-friendly format is:
http://www.example.com/a/256/my-title
Subscribe to:
Posts (Atom)