Home Tutorials Lyften blog

Lyften blog

March 13, 2010 Freebies by Author

In previous example we have used general technique to simply hide query string markers. But much more useful solution for search engine optimization would be making your URL keyword rich. Consider the following URL: http://www.mysite.com/productpage.asp?productID=127 This is a common situation for most web sites.

 

But you can significantly increase rating of your page in search engines by using the following URL format instead: http://www.mysite.com/products/our_super_tool.asp Keywords “our super tool” in this URL will be indexed and improve page rank. But “our_super_tool” cannot be used to retract productID=127 directly. Several solutions to this problem exist.

The first solution that we would recommend if you have short URL format with only few parameters is to include in URL both keywords and numeric identifiers. In this case your URL may look as: http://www.mysite.com/products/our_super_tool_127.asp Only one rule will be needed to achieve this rewrite:

RewriteEngine on
RewriteBase /
RewriteRule ^products/[^?/]*_(\d+)\.asp /productpage.asp?productID=$1

Another, more complex but effective, solution is to create 1 to 1 map file and use it to map “our_super_tool” to 127. This solution is useful for some long URLs with many parameters and will allow you to hide even numeric identifier. The URL will look as http://www.mysite.com/products/our_super_tool.asp. Please note that “our_super_tool” part should uniquely identify the product and it’s identifier. Here is an example for this solution:

RewriteEngine on
RewriteBase /
RewriteMap mapfile txt:mapfile.txt
RewriteRule ^products/([^?/]+)\.asp /productpage.asp?productID=${mapfile:$1}

 

 

 

 

Share Me!
Leave a Comment

Comments (2)

  • User Apr 27, 2010
    hello hello
  • User Mar 28, 2010
    This is a test comment on one of the articles.
DreamTemplate My Vector Store The CSS Awards Woork Advertise with Us
LyftenBloggie Categories
LyftenBloggie Authors
Login Form
Lost Password | Forgot Username
Logins

Blog Author
Username: Author
Password: author

Normal User
Username: User
Password: user

Backend Manager/Blog Administrator
Username: Demo
Passowrd: demo

Backend