basic question: how do I make .html in domain lead to .php?

Discussion in 'PHP' started by Domainer426, Aug 28, 2010.

  1. #1
    Hey,

    I copied all of the files from my website onto a different hosting account and a different domain. Now when I click on links, I get an error message. I think some settings must have gotten messed up. In the URL address bar the links end in ".html" and they used to work but no longer work. But if I manually type in ".php" at the end instead of ".html" everything works. Any idea whats up? Is there a way to make it so that all ".html" files automatically direct to ".php", or something like that (if that makes any sense)? Thanks

    (p.s. I know nothing about php)

    Thanks again
     
    Domainer426, Aug 28, 2010 IP
  2. mjewel

    mjewel Prominent Member

    Messages:
    6,693
    Likes Received:
    514
    Best Answers:
    0
    Trophy Points:
    360
    #2
    Did you copy your old htaccess file?

    If the files you copied end in .html, and you want html to parse php code, you need to have an htaccess file with something like this in it:

    AddHandler application/x-httpd-php5 .php .htm .html

    If your files end in php, but you want them to display at .html, they your old htacess file should have the proper rewrites in it.
     
    mjewel, Aug 29, 2010 IP
  3. Domainer426

    Domainer426 Active Member

    Messages:
    101
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #3
    you're right, I just needed to find a copy of the old .htaccess file. Thanks
     
    Domainer426, Aug 29, 2010 IP