make one .php file read as an .htm file

Discussion in 'PHP' started by ssmeredith, Apr 6, 2009.

  1. #1
    I have had to change a form to work with a CRM system. The form is a .php form yet all the links in my website are .htm pages.

    My question is, can I use Mod_rewrite (internal?) so all of the pages pointing to the old form.htm page will be redirected to the new form.php page so we don't have any broken links?

    Am I overthinking this? Or I am remembering an easy mod rewrite to accomplish this? Just don't know where I can find it again.

    Any help will be greatly appreciated!

    M
     
    ssmeredith, Apr 6, 2009 IP
  2. Tommy Arnold

    Tommy Arnold Active Member

    Messages:
    525
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    80
    #2
    search google for "301 redirect using .htaccess"
     
    Tommy Arnold, Apr 6, 2009 IP
  3. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #3
    RewriteEngine On
    RewriteRule ^form.htm form.php
     
    SmallPotatoes, Apr 6, 2009 IP
  4. ssmeredith

    ssmeredith Guest

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thank you for your help. My htaccess file was cluttered with Frontpage extension garbage ( really I only use it as a straight html editor - I swear) and caused havoc when I posted any more code there. So I said let me try something and changed the extension to .htm and the little bugger worked! The only problem I had after that was the thank you page had to be a php extension or it wouldn't work, but that was ok because nothing else had to link to that anyway - so overall in my recent events of 1Million things going wrong, my day has just improved!!!

    And I say thank you guys for getting back with help so quickly - Big Hugs!!

    Meredith
     
    ssmeredith, Apr 6, 2009 IP
  5. manly_ninja

    manly_ninja Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    using .htaccess to change .php extension to .html extension or another extension
     
    manly_ninja, Apr 6, 2009 IP