301 Permanent Redirect using ASP

By StrangeWork.com: I’ve been using my search engine optimization skills on a few different sites recently. The Democrats for Monmouth County website is my current challenge. One of the main challenges I faced was converting the old ugly links over to the new SEO friendly links without losing placement in the search results.

Link conversion example
Old URL:
http://mcds2007.com/Default.asp?P=393

New URL:
http://mcds2007.com/contact

To keep your existing search engine rank, use a Permanent 301 Redirect to force the spiders to the new link. Simply add the below code to the top of your ASP script:

Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”, “/contact”

Easy as that! Google, Yahoo, and the rest of the search engines will update your site links in their index without penalizing the new link.

Popularity: 32% [?]

Tags: , ,

How To: Create Custom ASP URLs with Querystrings using ISAPI Rewrite

ISAPI Rewrite is a powerful URL manipulation engine based on regular expressions. It acts mostly like Apache’s mod_Rewrite, but is designed specifically for Microsoft’s Internet Information Server (IIS). ISAPI_Rewrite is an ISAPI filter written in pure C/C++ so it is extremely fast. ISAPI_Rewrite gives you the freedom to go beyond the standard URL schemes and develop your own scheme.

Below are a few very easy to follow ISAPI Rewrite rules using regular expressions:



EXAMPLE 1

DESCRIPTION:
use one querystring as a subdirectory

ORIGINAL URL:
domain.com/member.asp?username=brad

NEW URL:
domain.com/brad

ISAPI REWRITE RULE:
RewriteRule /([^/]+) /member.asp\?username=$1 [I,L]



EXAMPLE 2

DESCRIPTION:
use two querystrings as subdirectories

ORIGINAL URL:
domain.com/member.asp?username=brad&page=2

NEW URL:
domain.com/brad/2

ISAPI REWRITE RULE:
RewriteRule /(?!images|js|css)([^/]+)/([^/]+) /member.asp\?username=$1&page=$2 [I,L]

* notice the (?!images|js|css) section of the rule. This piece tells the above rule to ignore those subdirectories (images, js, css).



EXAMPLE 3

DESCRIPTION:
use one hard coded subdirectory and one querystring as a subdirectory

ORIGINAL URL:
domain.com/member.asp?user_id=1

NEW URL:
domain.com/widget/1

ISAPI REWRITE RULE
RewriteRule /widget/([^/]+) /member.asp\?user_id=$1 [I,L]


Search engine spiders, and users, will ONLY see the newly formatted link. The querystrings are still being passed to the server, but they are not visible to anyone surfing the site. This is a HUGE advantage for making a dynamic site SEO friendly. Search engine spiders have always had issues with long complex querystrings, but masking the URL using ISAPI REWRITE has finally closed the gap between dynamic sites and SEO.

ISAPI Rewrite Homepage

Popularity: 37% [?]

Tags: , , ,