.htaccess file to run a RSS feed .php script on .htm pg

Discussion in 'Apache' started by eschumann, Mar 29, 2006.

  1. #1
    Hello all, I am stumped :confused: I have a .htm page that I am wanting to include a .php script which contains a RSS feed. I want to keep the .htm file extension because all of my pages are already indexed, changing the file extension to .php is not a option.

    I have the code for the php file for the RSS feed. It 100% works.

    I am using this code for my .htaccess file which I am 99% sure is right but I have never gotten it to work:

    AddType application/x-httpd-php .html .htm

    OK, the .htm pg I am getting this error when I include the .php script:

    %s", trim($link),htmlspecialchars(trim($title))); printf("
    %s

    ",htmlspecialchars(trim($description))); $title = ""; $description = ""; $link = ""; $insideitem = false; } } function characterData($parser, $data) { global $insideitem, $tag, $title, $description, $link; if ($insideitem) { switch ($tag) { case "TITLE": $title .= $data; break; case "DESCRIPTION": $description .= $data; break; case "LINK": $link .= $data; break; } } } $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); $fp = fopen("http://news.search.yahoo.com/news/rss?p=Houston+Astros+&ei=UTF-8&fl=0&x=wrt","r") or die("Error reading RSS data."); while ($data = fread($fp, 4096)) xml_parse($xml_parser, $data, feof($fp)) or die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); fclose($fp); xml_parser_free($xml_parser); ?>

    When I change the file extension from .htm to .php the RSS feeds shows up and works properly.

    I emailed my host and they said my server has access to run this and it should work.

    Any ideas guys? I really am banging my head against the wall on this one. The .htaccess file is in my root as I type, I even tried to put it in the folder with the file(s) I want to use the RSS feed on just for giggles. Did not work, was told it should be in root.

    Big major ups to anyone that can help me solve this one.
     
    eschumann, Mar 29, 2006 IP
  2. eschumann

    eschumann Peon

    Messages:
    16
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Does anyone have any suggestions on testing a .htaccess file?
     
    eschumann, Mar 31, 2006 IP
  3. eschumann

    eschumann Peon

    Messages:
    16
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I just tried the .htaccess file and .php script on another server and it worked..... My host told me it should work on my server? I emailed them the url of where it worked, it has to be the server right?

    Anybody know any specs I need that may not be on the server so I can tell them?
     
    eschumann, Mar 31, 2006 IP
  4. eschumann

    eschumann Peon

    Messages:
    16
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    can uploading the .htaccess using the dreamweaver FTP cause a issue? Come on guys, I am new to this forum, someone here is bound to be able to give me some sort of direction. Thanks!
     
    eschumann, Apr 4, 2006 IP
  5. eschumann

    eschumann Peon

    Messages:
    16
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Found out that I was misinformed on my server if anyone was curious. sorry.
     
    eschumann, Apr 5, 2006 IP