ASP.net directory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • strangerrr
    Junior Member
    • Sep 2004
    • 7

    ASP.net directory

    Hi everyone ... my programming team is planning to prepare web directory in asp.net ... I need to give them suggestion ... to make asp.net directory crawlable ... what things should be kept in mind to make it search engine friendly ...

    Can anyone suggest me so that i can p*** it on to my programme team ...
  • kevin
    Love is life
    • Dec 2015
    • 83

    #2
    Hi

    It is fact that 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.

    It is very easy to create seacrh engine friendly URL using apache. In apache we can use MOD REWRITE Function in the .htaccess file.

    To create search engine friendly URL using ASP.NET (C#. NET), I have want to share some ponints:-


    Instead of sending parameters like
    http://www.yourdomain.com?pageid=4 which is not search engine friendly

    You want to change it to
    Free classified ads with photos. Find houses and apts for rent, personals, jobs, cats, and dogs for sale.

    ========================================


    In your Global.asax file, modify the Application_BeginRequest event as the following:


    protected void Application_BeginRequest(Object sender, EventArgs e)
    {

    HttpContext incoming = HttpContext.Current;
    string oldpath = incoming.Request.Path.ToLower();
    string pageid; // page id requested

    // Regular expressions to grab the page id from the pageX.aspx
    Regex regex = new Regex(@"page(\d+).aspx", RegexOptions.IgnoreCase
    | RegexOptions.IgnorePatternWhitespace);
    MatchCollection matches = regex.Matches(oldpath);

    If (matches.Count > 0)
    {
    // Extract the page id and send it to Process.aspx
    pageid = matches[0].Groups[1].ToString();
    incoming.RewritePath("Process.aspx?pageid=" + pageid);
    }
    else
    {
    // Display path if it doesn’t containt pageX.aspx
    incoming.RewritePath(oldpath
    }
    }
    In the above code, URLs of incoming requests are scanned to determine if the URL includes “pageX.aspx”, where X=1,2,3…n
    ================================


    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.

    <%
    string pageid = Request.QueryString["pageid"];
    // Create the page content based on this pageid taken here
    %>
    =================================

    Issue a test request

    Free classified ads with photos. Find houses and apts for rent, personals, jobs, cats, and dogs for sale.

    Comment

    • strangerrr
      Junior Member
      • Sep 2004
      • 7

      #3
      Thank you very much Jagan .... these information i showed to my programming team and its very useful for them ....

      I would like to thank u once again ...

      Comment

      • kevin
        Love is life
        • Dec 2015
        • 83

        #4
        hi

        you are always welcome when you need the help and we try to provide best in this disscussion forum

        Comment

        • strangerrr
          Junior Member
          • Sep 2004
          • 7

          #5
          Hi Jagan .. finally we have launched web directory using your url rewrite idea... Thank you once again ... I would like to invite people to submit their site ..... its free ...

          InfoWebWorld Web Directory

          Comment

          • kevin
            Love is life
            • Dec 2015
            • 83

            #6
            hi

            I have visited directory and this looks good and i hope you will get good page rank soon. I hope that my this post will also help other seeking URL rewrite options for making search engine friendly directory in ASP.net

            Comment

            Working...
            😀
            😂
            🥰
            😘
            🤢
            😎
            😞
            😡
            👍
            👎