1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Parsing ASP in .html files

Discussion in 'C#' started by oziman, Mar 16, 2007.

  1. #1
    Hi Folks!
    SEMrush
    I'm not an ASP programmer, but I have an issue. I have a client who needs to 301 redirect pages that end in .html. Since this isn't Apache there's no .htaccess to implement redirects.

    Is there any way to take existing .html files and have them parsed by the ASP component (Sort of like AddHandler in Linux)?

    Thanks
     
    oziman, Mar 16, 2007 IP
    SEMrush
  2. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,607
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #2
    how to do it in ASP:

    <%@ Language=VBScript %>
    <%
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location", "http://www.google.com1"
    %>

    In HTML? You are probably going to have to manually do it in IIS. Their might be an IIS filter that allows dynamic HTML handling for 301s but I would just do it in IIS :)
     
    ccoonen, Mar 16, 2007 IP
  3. VishalVasani

    VishalVasani Peon

    Messages:
    560
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hello,

    Yes you can process asp in .html files. For that you required to changes setting in IIS.

    Following are the step to change this setting:

    1) Open IIS
    2) Select your Website
    3) Press Right Click Mouse Button & click on Properties
    4) Select Home Directory Tab & click on Configuration Button
    5) In Application Mapping & If .html Extension is their & select it & click edit button
    6) In Edit Dialog Box In Executable text box add 'C:\WINNT\System32\inetsrv\asp.dll' or path to asp.dll & press ok..

    Your done with this now your .html page will process the asp code....
     
    VishalVasani, Mar 25, 2007 IP
  4. soccerwiz

    soccerwiz Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This worked for me in IIS 6, but I have upgraded to IIS 7 and don't know how to configure IIS7 to properly process asp in .html files. Any ideas?
     
    soccerwiz, Aug 31, 2010 IP