Process URLs and redirect?

Discussion in 'ASP .Net' started by r, Nov 3, 2008.

  1. r

    r Guest

    Hi all
    I want to process all of urls of mysite.
    for instance I have a site named www.example.com
    when user enters xxx.example.com or www.example.com/yyy/ or anything
    related to my site be processed by my handler and then be redirected to
    proper page..
    thanks in advance
     
    r, Nov 3, 2008
    #1
    1. Advertising

  2. try using the Application_BeginRequest event in global.asax

    you can get all the parts of the url like this


    Dim url As Uri = Request.Url
    Dim scheme As String = url.Scheme
    Dim host As String = url.Host
    Dim pathQuery As String = url.PathAndQuery

    and to be search engine friendly use 301 redirects


    Response.Status = "301 Moved Permanently"
    Response.AddHeader("Location", newUrl)



    "r" <> wrote in message
    news:...
    > Hi all
    > I want to process all of urls of mysite.
    > for instance I have a site named www.example.com
    > when user enters xxx.example.com or www.example.com/yyy/ or anything
    > related to my site be processed by my handler and then be redirected to
    > proper page..
    > thanks in advance
    >
     
    ThatsIT.net.au, Nov 3, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kaidi
    Replies:
    5
    Views:
    475
    Andrew Thompson
    Jan 4, 2004
  2. Nathan Sokalski

    Converting Relative URLs into Absolute URLs

    Nathan Sokalski, Aug 11, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    747
    Sriram Srivatsan
    Aug 12, 2008
  3. Adam Monsen

    JDBC URLs ...not really URLs?

    Adam Monsen, Feb 6, 2009, in forum: Java
    Replies:
    11
    Views:
    6,218
    Adam Monsen
    Feb 8, 2009
  4. Sal
    Replies:
    1
    Views:
    519
  5. Steve T.

    dynamic URLS convert to static URLS for search engines

    Steve T., Mar 1, 2004, in forum: ASP .Net Web Services
    Replies:
    7
    Views:
    293
    Steve T.
    Mar 4, 2004
Loading...

Share This Page