Url Rewriting !! need help [Answered]RSS

8 replies

Last post Dec 31, 2010 01:44 AM by newbiefreak

  • Url Rewriting !! need help

    Dec 29, 2010 11:18 PM|newbiefreak|LINK

    hi everyone ,

     

    i am having little issue related to url rewriting handling it with IIS 5.0 on Windows XP pro ...

    can someone guide how to handle it in IIS 5.0 while using classic asp with vbscript

    i have to change *.htm to *.asp using url rewriting  

     

    thanks

     

  • Re: Url Rewriting !! need help

    Dec 29, 2010 11:35 PM|windian7|LINK

    hi~

    use isapi filter

    view link 

    http://blogs.msdn.com/b/dotnetinterop/archive/2008/06/18/rewriting-urls-on-iis5-iis6-or-iis7-mod-rewrite-on-iis.aspx

    isapi module

    Ionics Isapi Rewrite Filter

    http://iirf.codeplex.com/

    you can do find old version support IIS5.

  • Re: Url Rewriting !! need help

    Dec 30, 2010 12:09 AM|newbiefreak|LINK

    thanks for the info. but i am trying to use 404 trigger custom error

    i dont wanna change my senior work since he told me to explore it yourself 

    he had created a 404local.asp page and pointed 404 error to that file but i receive error

    "IE is not able to open this internet site. the request site is either unavailable or cannot found try again later."

    here is the code of the page

     

    URL=Request.ServerVariables("QUERY_STRING")
     
    nIndex = InStrRev(URL,"/")

     If (nIndex>0) Then
      URL = Right(URL,Len(URL)-nIndex)
      'URL = Left(URL,nIndex-1)
     End If
     URL=Replace(URL,".htm",".asp")
     
     
     If IsFileExists(Server.MapPath(URL)) Then
      If LCase(Request.ServerVariables("HTTP_HOST")) = "localhost" Then
       URL= "/abc/" & URL
      Else
       URL= "/" & URL
       
      End If
      Server.Transfer(URL)
     Else
      response.redirect("/")
     End If

     

     

  • Re: Url Rewriting !! need help

    Dec 30, 2010 12:46 AM|HCamper|LINK

    newbiefreak

    thanks for the info. but i am trying to use 404 trigger custom error

    i dont wanna change my senior work since he told me to explore it yourself 

    he had created a 404local.asp page and pointed 404 error to that file but i receive error

    "IE is not able to open this internet site. the request site is either unavailable or cannot found try again later."

    here is the code of the page

    URL=Request.ServerVariables("QUERY_STRING")
     
    nIndex = InStrRev(URL,"/")

     If (nIndex>0) Then
      URL = Right(URL,Len(URL)-nIndex)
      'URL = Left(URL,nIndex-1)
     End If
     URL=Replace(URL,".htm",".asp")
     
     
     If IsFileExists(Server.MapPath(URL)) Then
      If LCase(Request.ServerVariables("HTTP_HOST")) = "localhost" Then
       URL= "/abc/" & URL
      Else
       URL= "/" & URL
       
      End If
      Server.Transfer(URL)
     Else
      response.redirect("/")
     End If

    Hello,

    I am a Student in University.

    Learning is fun but time consuming!

    I will not code this problem just make some suggestions.

    item 1.) How much asp and html coding have you done?

               Most of the asp can embeded in html.

    item 2.) If given a choice the URL request is least useful.

                And most professors and companies  what a very generic works for all solutions.

    item 3.)  I would request more server information and put into an array.

    item 4.) Things to get from and check in the array and for 404 error substring for the more detals on 404 error.

    Below is the information from MSDN and IIS 6.0 codes.

    Table:

  • 404 - Not found.
    • 404.0 - (None) – File or directory not found.
    • 404.1 - Web site not accessible on the requested port.
    • 404.2 - Web service extension lockdown policy prevents this request.
    • 404.3 - MIME map policy prevents this request.

    Using the extending information compare and respond for all possible

    server side conditions.

    Example: The response code was 404.2 which is an offer from his 404local.asp the actual file exists but permissions to access

                    the offered file are restricted by a server rule or permissions.

    item 5.) As a general refernce the MSDN Library has code examples and the "Microsoft Download Center"

                has working samples.

    LOL

    Martin:)

Windows and Linux work Together IT-Pros
Community Member Award 2011
  • Re: Url Rewriting !! need help

    Dec 30, 2010 01:23 AM|newbiefreak|LINK

    Thanks for the reply and giving suggestion (which is better than no reply for gather knowledge )  Martin

    i answer few of ur suggestions

    1) cant be applied since i have more than 200 pages embeding code in each htm file take alot of time

    2) didnt understand the point .....

    3) more information in querystring isnt required since i m just access pages which are developed in asp classic

    4) i am not using IIS 6.0 i have already posted that i am using IIS 5.0 in which only 404 error is available

    5) started trying to find the best possible solution from MSDN library still not found

    Thanks Again

    i just want to change http://localhost/abc/abc.htm to http://localhost/abc/abc.asp

    by using 404 trigger which i am unsuccessful till now

    :(

  • Re: Url Rewriting !! need help

    Dec 30, 2010 01:54 AM|HCamper|LINK

    newbiefreak

    thanks for the info. but i am trying to use 404 trigger custom error

    i dont wanna change my senior work since he told me to explore it yourself 

    he had created a 404local.asp page and pointed 404 error to that file but i receive error

    "IE is not able to open this internet site. the request site is either unavailable or cannot found try again later."

    here is the code of the page

    URL=Request.ServerVariables("QUERY_STRING")
     
    nIndex = InStrRev(URL,"/")

     If (nIndex>0) Then
      URL = Right(URL,Len(URL)-nIndex)
      'URL = Left(URL,nIndex-1)
     End If
     URL=Replace(URL,".htm",".asp")
     
     
     If IsFileExists(Server.MapPath(URL)) Then
      If LCase(Request.ServerVariables("HTTP_HOST")) = "localhost" Then
       URL= "/abc/" & URL
      Else
       URL= "/" & URL
       
      End If
      Server.Transfer(URL)
     Else
      response.redirect("/")
     End If

    Hello,

    I did some checking for what may serve as guide.

    There is a book by Sams Publishing" the Title is "Active Server Pages 2.0".

    The book has a chapter on "Responding to Requests with the Response Object".

    The code and discussion may help for your problem.

    LOL Martin :)

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: Url Rewriting !! need help

    Dec 30, 2010 03:33 AM|KristoferG|LINK

    Hello,

    I wrote a web application earlier, and the source code with an article is available here:

    http://www.it-notebook.org/iis/article/change_domain_redirect_custom_404.htm

    It is in ASP.NET, but i don't think it would be any problem to translate it to ASP. You will also want to change the way it works. When i was changing domain name i also renamed some of the articles, so i had to hard code this translation table. Since you will just change the extension, it will be easier, just parse the file name and substitute the extension.

    Kristofer Gafvert

    http://www.it-notebook.org
  • Re: Url Rewriting !! need help

    Dec 30, 2010 11:33 PM|vijaybhaskarReddy|LINK

    Hi see this URL i think u get the information http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx
    Regards,
    Vijayabhaskara Reddi
  • Re: Url Rewriting !! need help

    Dec 31, 2010 01:44 AM|newbiefreak|LINK

    thanks everyone for helping me out ...

    after becoming a laughing stock for 1 hour from senior he told me what was wrong ...

    and the mistake was ...

    i was giving 404 custom error file location link as C:\..\..\404.asp rather using URL location /abc/404.asp

    sorry for late posting the mistake ....

    Thanks everyone

  • ‹ Previous Thread|Next Thread ›