404 Trick for Web Promotion - Setting up IIS for custom errors
(Page 2 of 4 )
In order to get a static looking page name, you need to customize IIS. I recommend that you use IIS 5, because it uses two great objects (Server.Execute and Server.Transfer) in your Active Server Page. IIS 4 uses Response.Redirect, which is not suitable for this purpose, because search engines can see that the page is redirecting. Also, it opposes the rules of SE. Using redirection can even cause search engines to ban a website, which means that they will not index any page coming from that website.
Now you need to tell IIS that you want an Active Server Page (404.asp) to handle all the 404s that come to the site. First open Internet Service Manager and right click on the website for which you want to set the custom 404 error. Click on properties and choose the Custom Error tab. Now you will see a list of HTTP errors. Click on the 404 HTTP error and you will see the filename that is already associated with this error. All you need to do is edit this file directory by choosing Edit Properties. Now you can tell the URL about the custom 404 error (404.asp) file.
After you make this change, all 404 errors will be handled by 404.asp. An interesting thing about IIS is that it sends the page name that caused the error as parameters in the querystring.
Creating the database
Now let's consider a website which shows 100 products. We design one page (product.asp) to handle these 100 products. Now we only pass product id to that page and, corresponding to that product id, we fetch records of that product. The URLs look something like this:
www.mysite.com/product.asp?id=3
Surely those product ids are stored in the database along with other fields such as product name, price etc. We need to add one more field, say PageName. The PageName field will contain a suitable file name for that product. Remember, this file will not physically exist. Just like this:
| ID | PRODUCT NAME | PRICE | ....... | PAGENAME |
| 1 | Moviemaker for P800 | $200 | ....... | Moviemaker-for-p800.htm |
| 2 | DVD to Pocket PC | $100 | ....... | DVD-to-pocket-PC.htm |
| 3 | Samsung C100 | $150 | ....... | Samsung-C100.htm |
Using the database for that purpose is easy to handle and easy to remember. We fix the desired static looking pages in the database. These file names should follow the product name and, if possible, should contain keywords.
Next: Linking >>
More Website Promotion Articles
More By Burhan Khan