|
|
Home » ASP » Article
Search engine friendly URLs using ASP.NET (C#.NET)
|
| Article by: | Maziar Aflatoun (11/4/2003) |
|
| Sponsored by: | FindMyHosting - Web Hosting Search |
| Summary: | This article describes how one would create a search engine friendly ASP.NET (C# .NET) web site. |
|
| Viewed: 79888 times |
Rating (37 votes): |
|
3.5 out of 5 |
|
|
|
Search engine friendly URLs using ASP.NET (C#.NET)
Each year companies and individuals spend millions of dollars on websites
that depend on databases to offer dynamic content. Yet these sites never receive
the exposure they deserve. Database driven sites are used because their administration
is much easier than the sites with static content.
Usually, all it takes to update the contents of a database driven web site it making
changes to certain tables in the database.
Unfortunately, most of these database driven web sites rely heavily on parameters
to display contents since parameter passing is the easiest way to pass
information between web pages.
Yet, most search engines cannot or will not list any dynamic URLS. Dynamic URLs are said to contain elements such as ?, &, %, +, =, $, cgi-bin, .cgi. Hence, the pages which the hyperlinks point to will be ignored by the Web spider indexing the site.
I have been searching many top search engines for information on creating a search engine friendly web site using ASP.NET (C#. NET) and have not been able to find anything. So, I thought it would be a good idea to create an article and share it with the rest of the world.
Goal
Instead of sending parameters like
http://www.mydomain.com?pageid=4 which is not search engine friendly
we want to change it to
http://www.mydomain.com/page4.aspx
Prerequisites
In your Global.asax file, modify the Application_BeginRequest event as the following,
In the above code, URLs of incoming requests are scanned to determine if the URL includes “pageX.aspx”, where X=1,2,3…n
Your code
Next create a file Process.aspx which would display your web site content based on the pageid parameter (pageid=1…n) just like you would do normally.
Ex.
|
Select All Code
|
|
To test this out, issue a test request my calling the page:
http://www.yourdomain.com/page12.aspx
Here even though you are issuing a search engine friendly request, in the background you’re managing your parameters like you would normally do with parameters.
|
|
View highlighted Comments
User Comments on 'Search engine friendly URLs using ASP.NET (C#.NET)'
|
Posted by :
aleys at 14:27 on Monday, December 01, 2003
|
Well, I don't know where did you look for, but this information you wrote is not new....
Another solution could be also an ISAPI filter which can rewrite URL without any code.
E.g.
http://www.smalig.com/url_rewrite-en.htm
<Added>
Well, I don't know where did you look for, but this information you wrote is not new....
Another solution could be also an ISAPI filter which can rewrite URL without any code.
E.g.
http://www.smalig.com/url_rewrite-en.htm
--
<Added>
Well, I don't know where did you look for, but this information you wrote is not new....
Another solution could be also an ISAPI filter which can rewrite URL without any code.
E.g.
http://www.smalig.com/url_rewrite-en.htm
--
| |
Posted by :
sliechti at 08:11 on Monday, January 19, 2004
|
If you are searching for an Url Rewrite flter with Regular Expressions. Check this out: <a href="http://www.iismods.com" target="_blank">Url Rewrite for IIS</a>.
Happy coding.
<Added>
If you are searching for an Url Rewrite flter with Regular Expressions. Check this out: http://www.iismods.com .
Happy coding.
| |
Posted by :
sugumar at 22:22 on Wednesday, February 21, 2007
|
This article is useful for me thanks for posting this article.
| |
Posted by :
anrorathod at 23:30 on Thursday, August 23, 2007
|
Hi,
I have read this article and implemented it. This is really fantastic.
But, I am facing problem for image path in following situation,
I have a "client" folder and there is a page in this folder, "test.ascx" and there is a image in this page.
now,I have rewrite the url path and everything is working fine, but there is problem in path... and it shows image path is - "http://localhost/testproject/client/images/win2000.gif"
but it should "http://localhost/testproject/images/win2000.gif".
So, can you please help me for this problem ?
Regards,
Rohit Rathod
| |
Posted by :
abhijitaitwade at 08:16 on Sunday, November 04, 2007
|
Hi Maziar,
I have http://www.yourdomain.com/productdeatil.aspx?Id=91 this page and i want rewrite it as
http://www.yourdomain.com/productdeatil.aspx/91/
Please guide me for that.
Thnaks,
Abhijit
| |
|
To post comments you need to become a member. If you are already a member, please log in .
| |