I am making one website about books and the user reaches the book which he/she intends by traversing though the subjects, then categories and then the subcategories.
As usual, I have made pages that use query strings like this
www.mywebsite.com/subjects.aspx?subjectid=10
The subjectid refers to one of the subjects.
The the user selected the categories and then subcategories and reaches the book.Now, everything is referred by it's id and not by it's name.
Now my question is that the Search Engines dont know how many subjeccts are there and the subject names are not understandable from the id(s).
When I tried to use Google Custom Search, and passed on the url of my website it does not go deep to the book level, instead stays on the main url www.mywebsite.com.
There are some website that I have seen have URL like this:
http://dotnetslackers.com/articles/aspnet/Implementing-Search-in-ASP-NET-with-Google-Custom-Search.aspx
Do they really create a seperate aspx page for each and every article ?
I maynot be able to make you people understand what I want coz I just started asp.net so please think that it has got to do with SEO.
If any clarification is need, please comment and will edit the question.
EDIT 1: Just when I posted this question I noted that it has also created a similar type of page:
http://stackoverflow.com/questions/5581873/seo-layout-of-the-website
Now, Is that a new folder "seo-layout-of-the-website" !
EDIT:2 SO it appears that URL Rewriting is what I need. The example given in one tutorial states that for urls like :
http://www.store.com/products.aspx?category=books http://www.store.com/products.aspx?category=DVDs http://www.store.com/products.aspx?category=CDsI can redirect them to http://www.store.com/products.aspx/Books
http://www.store.com/products.aspx/DVDs http://www.store.com/products.aspx/CDsBut in my case, I am using Ids, so does that mean that I should use the names (subject.aspx?subjectname=abcd instead of su开发者_JAVA百科bject.aspx?subjectid=123) ?
URL Rewriting is what you're looking for. So you could convert your URL:
www.mywebsite.com/subjects.aspx?subjectid=10
to:
www.mywebsite.com/subject/10
by adding a route to it. If you're using ASP.NET 4, you can do this easily. In your Global.asax.cs
file, define the following in the Application_Start
function:
using System.Web.Routing;
protected void Application_Start(object sender, EventArgs e)
{
RouteTable.Routes.MapPageRoute(
"SubjectRoute",
"subject/{subjectId}",
"~/subjects.aspx"
);
}
And in subjects.aspx.cs
, get the value with:
if (Page.RouteData.Values["subjectId"] != null)
{
var mySubjectId = Page.RouteData.Values["subjectId"].ToString());
}
No, they don't create new pages for SEO purpose. what most of us do is rewrite the URL rule in htaccess or apache files. I dont know how it works in asp though
精彩评论