Article Options
Premium Sponsor
Premium Sponsor

 »  Home  »  Web Development  »  ASP.NET  »  How to create dynamic doorway pages in ASP.NET
How to create dynamic doorway pages in ASP.NET
by Yousuf Baqir | Published  02/08/2005 | ASP.NET | Rating:
Yousuf Baqir
.Net software Developer and designer. Currently working at Verticity Pvt. Ltd. - Karachi, Pakistan. Blog: www.weblogs.com.pk\yousufmb 

View all articles by Yousuf Baqir...
How to create dynamic doorway pages in ASP.NET

What are doorway pages?

One of the techniques performed in search engine optimization of any website is to create a doorway page or pages, often called hallway or mirror page.

"A well built doorway page system can provide tremendous advantages to a web site owner. It will allow you to maximize your web traffic by targeting multiple keywords and keyword phrases. 

The overall theme with a master doorway system is simply the use of keywords. The most difficult part for many to understand is how doorway pages really work. By themselves, they are not anything magical. A doorway page is no more effective then a standard optimized web page. Actually, when examined by itself, a doorway page is really nothing more then a standard web page. What makes a web page a doorway page is how it is used. That's it. It's the application." – Search Engine Strategies. 

There can be a single page that has link to all the doorway pages. The link to this page can be added to the index page of the site so that it is easier for the search engines to find it. Once the search engine finds this page it will also find all the doorway pages whose links are on it. 

A singe doorway page can be optimized for only one keyword (or keyword phrase). This means that for each keyword that we are targeting we will have to create a separate doorway page.

A particular website might require optimization by targeting several keywords. For example the last site I was working on required the optimization for around 1000+ keywords!


Creating dynamic doorway pages in ASP.Net

To work around this problem we can create a database which has a table with one column containing all the keywords and another containing corresponding text for the doorway page. The page will now be created dynamically for each keyword.  

For example if my keyword is ‘programming' then the URL to access this page will look like: 

http://www.mywebsite.com/mydoorway/mydootwaypage.aspx?kw=programming 

Those of you who are familiar with search engine optimization techniques know that we STILL have a problem. Yes, we can not have a URL containing characters like ‘?' or ‘%'. This is because search engines do not consider such URLs.  

So what we need to do now is to access these dynamic doorway pages with a search engine friendly URL, such as :

   www.mywebsite.com/mydoorway/java_programming.aspx 

(Note that we added an underscore character in the keyword phrase instead of space between words to avoid the ‘%' character).  

This is done in the Application_BeginRequest method of Global.asax.cs class of your web application. In this method write following code:

string strCustomPath;
string strCurrentPath = Request.Path.ToLower();
string strDoorWayPagePath = "www.mywebsite.com/mydoorway/" ;

if( strCurrentPath.IndexOf("/mydoorway") != -1 )
{
    strCustomPath = doorWayPagePath + " mydoorwaypage.aspx?kw=" + 
    Path.GetFileNameWithoutExtension(Request.Path);

    Context.RewritePath( strCustomPath );
}

That's it.

So now when you point your browser to

   http://www.mywebsite.com/mydoorway/java_programming.aspx

it actually will fetch a page from

   http://www.mywebsite.com/mydoorway/mydootwaypage.aspx?kw=java_programming

without revealing the underlying URL.

Of course you will have to write all the magic code to retrieve the keyword from the URL's query string, fetch corresponding text and display it on the page wherever you want it to be.

You can also suffix your URLs with .htm or any other extension instead of .aspx. All you have to do is configure your website through IIS so that .htm requests are handled by ASP.Net engine.

Happy SE Optimization!
 

How would you rate the quality of this article?
1 2 3 4 5
Poor Excellent
Tell us why you rated this way (optional):

Article Rating
The average rating is: No-one else has rated this article yet.

Article rating:2.734693877551 out of 5
 49 people have rated this page
Article Score21176
Sponsored Links