Show .asp pages on a Linux server

Discussion in 'Programming' started by HarriL, Dec 11, 2014.

  1. #1
    I have a site on a windows server which I'm now transferring to a Linux server.

    I'm in process of moving most of the content to wordpress but I would like to keep some of the content on the old .asp pages. Code in the .asp pages is just plain html.

    Now when I access the .asp page on my vrowser, it shows just as text, so is there a way to treat .asp pages as .html pages or something? Maybe using .htaccess?

    Thanks.
     
    HarriL, Dec 11, 2014 IP
  2. Nigel Lew

    Nigel Lew Notable Member

    Messages:
    4,642
    Likes Received:
    406
    Best Answers:
    21
    Trophy Points:
    295
    #2
    Nigel Lew, Dec 11, 2014 IP
  3. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #3
    If the code in the files are just plain HTML, can't you just rename the files to .html?
     
    PoPSiCLe, Dec 11, 2014 IP
    Nigel Lew likes this.
  4. Nigel Lew

    Nigel Lew Notable Member

    Messages:
    4,642
    Likes Received:
    406
    Best Answers:
    21
    Trophy Points:
    295
    #4
    I was just thinking the same thing actually.
    N.
     
    Nigel Lew, Dec 11, 2014 IP
  5. HarriL

    HarriL Member

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #5
    Yeah, I could but then I would have to do a 301 redirect... which is not a big problem but in the near future I might move also the rest of the pages to wordpress and then I would probably have to do another 301 redirect which is not good.

    So I was just wondering if there's an easy way to force my server to handle .asp files just as .html files so the browser could show them... but if there's no easy solution, then I quess I will move everything to Wordpress immediately... which is a lot of work but probably the best solution.
     
    HarriL, Dec 11, 2014 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #6
    Assuming it's on apache, you could theoretically use a .htaccess like this:

    AddType text/html .asp
    <FilesMatch "\.(asp)$>
      SetHandler None
      Options None
    </FilesMatch>
    Code (markup):
    To make sure that .asp files are fed as text/html and that the server doesn't try to run it as anything other than flat output. No clue if that code will actually work, but it's probably pretty close to how one would go about it. That SHOULD make .asp files behave on Apache just like they would if they had .htm or .html extensions.
     
    deathshadow, Dec 12, 2014 IP
  7. HassanKhalid

    HassanKhalid Active Member

    Messages:
    158
    Likes Received:
    6
    Best Answers:
    4
    Trophy Points:
    90
    #7
    Try mono.
     
    HassanKhalid, Dec 12, 2014 IP