How to Create Static and Dynamic Websites in IIS and ASP
- Date: 2007-01-12 - Word Count: 547
Share This!
You've got your web server running, and you're ready to dive headfirst into creating your first site or three. How should you set them up? There are a few neat tricks you can do with IIS involving host headers and custom error pages. In this article, I'll describe to you in detail how to use these features to set up dynamic websites that will respond to any domain name, as well as how to set up cystom dynamic file structures that let you name your pages in whatever manner you wish (which is extremely useful for SEO).
I'll assume you already know how to set up a basic web site in the IIS console (right-click, New Site, yadda yadda). If you haven't made a folder for and created a basic site, do that now so we'll have something to play with. Right-click on it once you've created it and go to Properties, then click the Advanced button on the first tab that comes up. This is where you define host headers for your website, what domain names the website should respond to.
If you create an entry for Port 80, but leave the Host Header Name field blank, then IIS will use this site to respond to all requests that the Web Server receives, regardless of the domain! You can then have one site respond to any number of domains or subdomains, and they could even be determined and handled dynamically by the server script language.
Hit OK or cancel to leave the host header window, and on the main properties window go to the Custom Errors tab. Scroll down in the list until you see 404. This is the configuration setting for this website for how IIS responds to requests for pages that do not exist. If you open up the properties of the 404 entry, you can change the Message Type setting to be "URL", and where it says File you can type in "/404.asp" (without the quotes).
Now whenever someone requests a page that doesn't exist at this website, say "www.yourdomain.com/articles/", instead of returning the normal 404 error screen ("page not found"), it will process the "/404.asp" file on your website. That file can then, according to whatever you write the script to do, look in your database for an article with the name of the file that was requested, for example. Thus all of your articles, news, and other dynamic content pages, can also have dynamic URLs -- not dynamic in the sense that they are changing, but in the sense that it doesn't matter what the URL is. You can optimize it completely for SEO, such as "http://www.yourdomain.com/Article-Keywords-Info/".
Of course, your web server will still register that as a 404 hit, but who cares. You can also copy the 404b.htm file from the default directory (look at another web site's setting in IIS to get the default file name and location) to your website root, and then in the dynamic 404.asp file, if the article name can't be found, you can then redirect the user back to the 404b.htm original error page. Perfect!
======================================================================
This article was written by Lucas Green, a professional website developer who
lives off his internet income. Visit www.lucasgreen.com to learn how to use the
internet to create multiple passive income streams and achieve financial freedom!
http://www.LucasGreen.com
======================================================================
I'll assume you already know how to set up a basic web site in the IIS console (right-click, New Site, yadda yadda). If you haven't made a folder for and created a basic site, do that now so we'll have something to play with. Right-click on it once you've created it and go to Properties, then click the Advanced button on the first tab that comes up. This is where you define host headers for your website, what domain names the website should respond to.
If you create an entry for Port 80, but leave the Host Header Name field blank, then IIS will use this site to respond to all requests that the Web Server receives, regardless of the domain! You can then have one site respond to any number of domains or subdomains, and they could even be determined and handled dynamically by the server script language.
Hit OK or cancel to leave the host header window, and on the main properties window go to the Custom Errors tab. Scroll down in the list until you see 404. This is the configuration setting for this website for how IIS responds to requests for pages that do not exist. If you open up the properties of the 404 entry, you can change the Message Type setting to be "URL", and where it says File you can type in "/404.asp" (without the quotes).
Now whenever someone requests a page that doesn't exist at this website, say "www.yourdomain.com/articles/", instead of returning the normal 404 error screen ("page not found"), it will process the "/404.asp" file on your website. That file can then, according to whatever you write the script to do, look in your database for an article with the name of the file that was requested, for example. Thus all of your articles, news, and other dynamic content pages, can also have dynamic URLs -- not dynamic in the sense that they are changing, but in the sense that it doesn't matter what the URL is. You can optimize it completely for SEO, such as "http://www.yourdomain.com/Article-Keywords-Info/".
Of course, your web server will still register that as a 404 hit, but who cares. You can also copy the 404b.htm file from the default directory (look at another web site's setting in IIS to get the default file name and location) to your website root, and then in the dynamic 404.asp file, if the article name can't be found, you can then redirect the user back to the 404b.htm original error page. Perfect!
======================================================================
This article was written by Lucas Green, a professional website developer who
lives off his internet income. Visit www.lucasgreen.com to learn how to use the
internet to create multiple passive income streams and achieve financial freedom!
http://www.LucasGreen.com
======================================================================
Related Tags: websites, create, dynamic, static, asp, 404, iis, host headers, custom errors
Your Article Search Directory : Find in Articles
Recent articles in this category:
- How to Capitalize on Free Content From Podcasts
One of the major challenges for every website owner is generating compelling content that will - Looking for a Niche? 40 Keyword Suggestions
One of the most important steps foraffiliate marketing and Internet marketing is finding a go - 5 Benefits Of Having Your Own Home Business
There is no secret to why millions of people are flocking to the internet to start their own h - Optimized Articles Drive Traffic to Websites
Benefits of SEO ArticlesSEO Articles can help move websites up in the search engines and are o - Why You Should Be Using an Online Backup Service
Online BackupOnline backup services are relatively new but they are gaining popularity at the - FREEDOM1-PACKAGE.COM/ YOUR TOP MONEY ONLINE BUSINESSES Presents:
FREEDOM1-PACKAGE.COM/ YOUR TOP MONEY ONLINE BUSINESSES!Presents:Evaluating Your Website Traffi - 3 Bonuses To Success University's Already Stellar Program
It is not very often that you will come across a program to the likes of Success University. - How to Optimize Your Website For Better Visitor Experience and More Traffic
This article describes in simple terms, practical and effective tactics used to optimize your - Do You Like Being On Top? A Global Domains International Position.
If you like to be on top then you are just like millions of other web site owners trying to po - Internet Marketer's Dream: 8 Productivity Tips for Firefox Browser Users
Here are 8 productivity tips specifically for Mozilla Firefox users:1) SearchStatus. Set your
Most viewed articles in this category:
- The Webmaster's Assistant
There are many tools available to a webmaster to analyse website traffic allowing them to monitor th - Free Webmaster Resources
The overall importance of Quality Web Development or Web Design Tools is a factor among webmast - Webmaster Staff Leasing
Some of you might be wondering what webmaster staffing means? So just to make it clear for everyone - Web Analytics - Getting It Right
Understanding and using web analytics.In recent years, website marketers were concerned with increas - 6 Steps to a More Successful Website in 2006
Another year has passed and a new one has dawned. It's an exciting time to have an online business. - Easy Content Management with Server Side Includes (part 1)
I honestly see very few websites that can really say they don’t need some sort of Content Mana - HTML Editors
If you're the typical non professional user then you are probably familiar with the more popular one - Want Your Website Visitors to Return?
If your like me you have searched on every search engine any possible way to advertise your website. - 4 Nearly FREE Ways for a Web Designer to Establish a Local Presence
Everyone seems to be a web designer these days. From your uncle’s neighbor’s nephe - Reasons why you should have a Weblogger installed on your web site.
Radhika Venkata (c).I don't know about you, but when I built my first web site threeyears back I don