Rewrite the URL in ASP?

Discussion in 'ASP General' started by Advo, Aug 4, 2006.

  1. Advo

    Advo Guest

    Advo, Aug 4, 2006
    #1
    1. Advertising

  2. Advo

    McKirahan Guest

    "Advo" <> wrote in message
    news:...
    > Hey.
    >
    > Basically Ive got an url:
    >
    > www.thepagename.com/town_page.asp?town_name=WHATEVER
    >
    > Basically need that to be written and shown in the browser like:
    >
    > www.thepagename.com/WHATEVER.html
    >
    > notice how i've added the .html, thats for our Search Engine
    > Optimisation, or it may not be needed? i dunno.
    >
    > Any ideas please?
    >
    > Ive done this in PHP before, but never with ASP.
    >
    > Thanks in advance!
    >


    Option Explicit
    Const cURL = "www.thepagename.com/town_page.asp?town_name=WHATEVER"
    Dim strURL '= www.thepagename.com/WHATEVER.html
    strURL = Left(cURL,InStr(cURL,"/"))
    strURL = strURL & Mid(cURL,InStrRev(cURL,"=")+1) & ".html"
    Response.Write cURL & "<br>" & strURL
     
    McKirahan, Aug 4, 2006
    #2
    1. Advertising

  3. Advo wrote on 4 Aug 2006 05:44:06 -0700:

    > Hey.
    >
    > Basically Ive got an url:
    >
    > www.thepagename.com/town_page.asp?town_name=WHATEVER
    >
    > Basically need that to be written and shown in the browser like:
    >
    > www.thepagename.com/WHATEVER.html
    >
    > notice how i've added the .html, thats for our Search Engine
    > Optimisation, or it may not be needed? i dunno.
    >
    > Any ideas please?
    >
    > Ive done this in PHP before, but never with ASP.


    Are you sure you did it in PHP? I think you'll find it was mod_rewrite which
    is an Apache add-on.

    > Thanks in advance!


    You'll need something like ISAPI_Rewrite (http://www.isapirewrite.com/)

    Dan
     
    Daniel Crichton, Aug 4, 2006
    #3
  4. Advo

    Advo Guest

    is there anything that you dont have to pay for though? Basically, its
    only for a simple task, therefore the boss didnt really want to have to
    buy anything to get it working :s


    Daniel Crichton wrote:
    > Advo wrote on 4 Aug 2006 05:44:06 -0700:
    >
    > > Hey.
    > >
    > > Basically Ive got an url:
    > >
    > > www.thepagename.com/town_page.asp?town_name=WHATEVER
    > >
    > > Basically need that to be written and shown in the browser like:
    > >
    > > www.thepagename.com/WHATEVER.html
    > >
    > > notice how i've added the .html, thats for our Search Engine
    > > Optimisation, or it may not be needed? i dunno.
    > >
    > > Any ideas please?
    > >
    > > Ive done this in PHP before, but never with ASP.

    >
    > Are you sure you did it in PHP? I think you'll find it was mod_rewrite which
    > is an Apache add-on.
    >
    > > Thanks in advance!

    >
    > You'll need something like ISAPI_Rewrite (http://www.isapirewrite.com/)
    >
    > Dan
     
    Advo, Aug 4, 2006
    #4
  5. "Advo" <> wrote in message
    news:...
    > Hey.
    >
    > Basically Ive got an url:
    >
    > www.thepagename.com/town_page.asp?town_name=WHATEVER
    >
    > Basically need that to be written and shown in the browser like:
    >
    > www.thepagename.com/WHATEVER.html
    >
    > notice how i've added the .html, thats for our Search Engine
    > Optimisation, or it may not be needed? i dunno.
    >
    > Any ideas please?
    >
    > Ive done this in PHP before, but never with ASP.
    >
    > Thanks in advance!
    >


    Unfortunately ASP doesn't provide a way to do this. This is an ISAPI level
    thing you'd need to write binary component to do this.

    Have considered turning the problem around the other way.

    Hand out the URL:- www.thepagename.com/WHATEVER.html

    Then make town_page.asp your custom 404 handler. Internally it will need to
    adjust the returned status code and parsing the query string for the correct
    info is messy but it should work.

    Just a thought,

    Anthony.
     
    Anthony Jones, Aug 4, 2006
    #5
  6. no money , no honey

    asp cant do it alone... you need a filter

    there is like one free one... but the pay ones work a lot better in my
    opinion
    the free one I used lcked up the site periodically



    "Advo" <> wrote in message
    news:...
    > is there anything that you dont have to pay for though? Basically, its
    > only for a simple task, therefore the boss didnt really want to have to
    > buy anything to get it working :s
    >
    >
    > Daniel Crichton wrote:
    >> Advo wrote on 4 Aug 2006 05:44:06 -0700:
    >>
    >> > Hey.
    >> >
    >> > Basically Ive got an url:
    >> >
    >> > www.thepagename.com/town_page.asp?town_name=WHATEVER
    >> >
    >> > Basically need that to be written and shown in the browser like:
    >> >
    >> > www.thepagename.com/WHATEVER.html
    >> >
    >> > notice how i've added the .html, thats for our Search Engine
    >> > Optimisation, or it may not be needed? i dunno.
    >> >
    >> > Any ideas please?
    >> >
    >> > Ive done this in PHP before, but never with ASP.

    >>
    >> Are you sure you did it in PHP? I think you'll find it was mod_rewrite
    >> which
    >> is an Apache add-on.
    >>
    >> > Thanks in advance!

    >>
    >> You'll need something like ISAPI_Rewrite (http://www.isapirewrite.com/)
    >>
    >> Dan

    >
     
    Kyle Peterson, Aug 4, 2006
    #6
  7. Gazing into my crystal ball I observed "Advo" <>
    writing in news::

    > Hey.
    >
    > Basically Ive got an url:
    >
    > www.thepagename.com/town_page.asp?town_name=WHATEVER
    >
    > Basically need that to be written and shown in the browser like:
    >
    > www.thepagename.com/WHATEVER.html
    >
    > notice how i've added the .html, thats for our Search Engine
    > Optimisation, or it may not be needed? i dunno.
    >
    > Any ideas please?
    >
    > Ive done this in PHP before, but never with ASP.
    >
    > Thanks in advance!
    >


    As others have said, ASP cannot do this by itself.

    However, search engines do not need to have the html extension, they can
    use anything, as long as they can get to the content.

    Here's my suggestion to you:
    1. Write valid markup - use strict HTML 4.01 or if you have need for it
    Strict XHTML 1.0
    2. Use semantic markup - if something is a heading, use a heading
    element. If it's a navigation list, use an unordered list. If its a
    paragraph, use a paragraph. Use tables for their intended purpose,
    tabular data. Do not use tables for presenation or postioning of
    elements.
    3. Separate content from presenation. Use no presenational markup at
    all, and put all your presentation into an external stylesheet. I'll go
    one further with that, and suggest one for positioning, and another for
    colors only.
    4. Put all javascript into an external file. Don't include it in the
    page unless you absolutely have to.
    5. Don't use document.asp?id=123. Google and others seem to not like id,
    perhaps they think they are going on an endless loop.
    6. For links that really don't matter, ie, document.asp?color=green, you
    can tell Google and others not to follow like this: <a
    href="document.asp?color=green" rel="nofollow">See the site in green</a>.
    7. Have a valid robots.txt file, but do not rely on it to keep bots away
    from places they should never go.


    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne Boswell, Aug 6, 2006
    #7
  8. Advo

    Jeff Cochran Guest

    ISAPIRewrite has a limited free version. Did you even look at the
    URL?

    Jeff

    >is there anything that you dont have to pay for though?
    >>
    >> You'll need something like ISAPI_Rewrite (http://www.isapirewrite.com/)
    >>
    >> Dan
     
    Jeff Cochran, Aug 6, 2006
    #8
    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. Michel

    Rewrite URL with Session possible?

    Michel, Dec 9, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    415
    Michel
    Dec 9, 2003
  2. =?Utf-8?B?amF2YXd6bA==?=

    URL Rewrite to classic ASP

    =?Utf-8?B?amF2YXd6bA==?=, Apr 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    3,101
    =?Utf-8?B?amF2YXd6bA==?=
    Apr 29, 2005
  3. =?Utf-8?B?VA==?=

    Rewrite asp url as aspx url?

    =?Utf-8?B?VA==?=, Jul 22, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    720
    gerry
    Jul 24, 2005
  4. baroque Chou

    Problems with asp.net level URL rewrite

    baroque Chou, Mar 10, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    623
    Bruce Barker
    Mar 10, 2006
  5. Martin
    Replies:
    0
    Views:
    1,221
    Martin
    Apr 28, 2010
Loading...

Share This Page