![]() |
![]() |
| Homepage | Article Title | Extending Your Page Names | ||||
| Catalog | Original URL | http://www.asp101.com/articles/wayne/extendingnames/ | ||||
| Backup Time | 6/10/2006 6:49:14 AM | |||||
| Executor IP | 66.110.110.4 |
So what is important to use in the strQ? In the example above it appears like: /applicances/dishwashers/kenmore/Model3809.htm. All we really need from it is the Model3809, since this could be the unique key to the product database. The following lines of code takes the model number and find the product id.
Now that we have the Product Id we need to store it before transferring to the correct .asp page. We can't pass the Product Id in the query string via the Server.Transfer (this is an IIS restriction). So, we pass it via the Session Object.
When you try this, your address bar in the browser will say: http://www.myserver.com/applicances/dishwashers/kenmore/Model3809.htm
and because of the Server.Transfer the URL in the browser's address bar doesn't change, also the browser doesn't have to perform another round trip, unlike Response.Redirect. Also notice that the directories do not exist at all, in fact it doesn't matter in this case what the rest of the URL says -- except the server name. For instance all these URLs go to the same page: http://www.myserver.com/Model3809.htm
So why put in the directories? The directories will give you higher search engine placement. Because some search engines use the words in the query string as stronger keywords to the search than words in the title or body of the HTML, directory names are very important. Calling Pages that Don't ExistWe have covered the technology to convert URLs that don't exist to dynamic URLs, however in order to get the search engine to traverse those pages you need to link to the URLs that don't exist. In other words, the only way the search engine is going to find your Model3809.htm page is if you link it up. When you linked this page before all you had to do was use the Product Id like this: " product.asp?Id=4", so lets take that Product Id and create a function that returns the correct URL.
Now when you want to add a URL you do it like this:
Note: In this example we assume you don't know the model name and you have to go back to the database -- in the real world this might not be the case. You know the model name and can create the URL without making another call to the database. PerformanceThere are some obvious performance issues associated with this technique. First, it might require an extra database call to create the well-named URLs that don't exist. Secondly, it will always require an extra database call to figure out the correct URL from the 404 URL. Finally, the two Server.Transfers are expensive. However, you can solve some of the performance problems using XCache. XCache will resolve the 404 URL to the right page and cache this information for later requests. ExampleAn example of this can be seen with http://www.kulshan.com. Most of the leaf pages on Kulshan.com, like the individual restaurants reviews, use this technique to get better search engine placement. Kulshan.com also uses XCache. SummaryCreate URLs that you can market and that work on search engines is fairly easy, if you don't have to create the directory structure and files that those URLs represent. Using IIS 5.0 Custom Error Page technology and handling the 404s can yield great pages names. Post Point SoftwareFounded in 1996 by Wayne and Dina Berry, Post Point Software is a lead innovator of Web caching software and Internet performance solutions. The company's flagship products XCache, XBuilder and XTune provide Web developers and site owners with robust performance solutions that significantly improve site experiences for their end users. Headquartered in Bellingham, Washington, Post Point received initial funding from iStart Ventures. For more information, visit www.postpointsoft.com or email info@postpointsoft.com. Related Articles
|
| Visit Cooltang's Homepage | TOP |