Parse .cfm files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matthew256

    Parse .cfm files

    I have a bunch of files with the extension .cfm with PHP code in them.
    It's a long story, but I need to keep the extension the same.
    Is there a way to make PHP parse the .cfm file?
    My web host says they can't do it on their end.
    Should I argue?

    Matthew

  • Jerry Stuckle

    #2
    Re: Parse .cfm files

    Matthew256 wrote:
    I have a bunch of files with the extension .cfm with PHP code in them.
    It's a long story, but I need to keep the extension the same.
    Is there a way to make PHP parse the .cfm file?
    My web host says they can't do it on their end.
    Should I argue?
    >
    Matthew
    >
    I can't say as I blame them. I wouldn't want to try adding non-standard
    extensions like this for every client.

    If this is Apache, they could with an AddType directive in the
    httpd.conf file. You could do it in the .htaccess file.

    But .cfm is a Cold Fusion template file. Why would you have php code in it?

    You'll be much better off in the long run if you change the extension to
    something standard like .php. Or just get yourself a virtual private
    server where you can do anything you want.

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • Pedro Graca

      #3
      Re: Parse .cfm files

      Matthew256 wrote:
      I have a bunch of files with the extension .cfm with PHP code in them.
      It's a long story, but I need to keep the extension the same.
      Is there a way to make PHP parse the .cfm file?
      PHP doesn't care about extensions.

      fopen(), fread(), and fclose() come to mind.
      If the .cfm is plain text I'd use file() instead.

      --
      I (almost) never check the dodgeit address.
      If you *really* need to mail me, use the address in the Reply-To
      header with a message in *plain* *text* *without* *attachments*.

      Comment

      • Joel Parish

        #4
        Re: Parse .cfm files

        Add the following line to the .htaccess file in the directory (If there
        is one, if not create it)

        AddType application/x-httpd-php .php .cfm #add any other extentions
        you want to be parsed


        Hope this helps,
        --Joel
        On Oct 29, 1:53 pm, "Matthew256 " <PRESENT...@gma il.comwrote:
        I have a bunch of files with the extension .cfm with PHP code in them.
        It's a long story, but I need to keep the extension the same.
        Is there a way to make PHP parse the .cfm file?
        My web host says they can't do it on their end.
        Should I argue?
        >
        Matthew

        Comment

        • Chung Leong

          #5
          Re: Parse .cfm files

          Jerry Stuckle wrote:
          >
          But .cfm is a Cold Fusion template file. Why would you have php code in it?
          >
          You'll be much better off in the long run if you change the extension to
          something standard like .php. Or just get yourself a virtual private
          server where you can do anything you want.
          My guess is that the OP needs to preserve the URLs in existing links.
          This is probably better handled through Apache rewrite than changing
          the file extension of the source files.

          Comment

          • Jerry Stuckle

            #6
            Re: Parse .cfm files

            Chung Leong wrote:
            Jerry Stuckle wrote:
            >
            >>But .cfm is a Cold Fusion template file. Why would you have php code in it?
            >>
            >>You'll be much better off in the long run if you change the extension to
            >>something standard like .php. Or just get yourself a virtual private
            >>server where you can do anything you want.
            >
            >
            My guess is that the OP needs to preserve the URLs in existing links.
            This is probably better handled through Apache rewrite than changing
            the file extension of the source files.
            >
            A 301 redirect takes care of things quite nicely - and permanently.

            --
            =============== ===
            Remove the "x" from my email address
            Jerry Stuckle
            JDS Computer Training Corp.
            jstucklex@attgl obal.net
            =============== ===

            Comment

            • Chung Leong

              #7
              Re: Parse .cfm files


              Jerry Stuckle wrote:
              Chung Leong wrote:
              Jerry Stuckle wrote:
              >But .cfm is a Cold Fusion template file. Why would you have php code in it?
              >
              >You'll be much better off in the long run if you change the extension to
              >something standard like .php. Or just get yourself a virtual private
              >server where you can do anything you want.

              My guess is that the OP needs to preserve the URLs in existing links.
              This is probably better handled through Apache rewrite than changing
              the file extension of the source files.
              >
              A 301 redirect takes care of things quite nicely - and permanently.
              >
              --
              =============== ===
              Remove the "x" from my email address
              Jerry Stuckle
              JDS Computer Training Corp.
              jstucklex@attgl obal.net
              =============== ===
              One would use rewrite to do that, naturally.

              Comment

              • NC

                #8
                Re: Parse .cfm files

                Matthew256 wrote:
                >
                I have a bunch of files with the extension .cfm with PHP code in them.
                It's a long story, but I need to keep the extension the same.
                Is there a way to make PHP parse the .cfm file?
                Yes. You can add an AddType directive to httpd.conf.
                My web host says they can't do it on their end.
                What they mean to say is that they don't WANT to do it. It requires
                changing Apache configuration file, which is against policy in many
                Web hosting companies.
                Should I argue?
                You can argue, but it is probably going to be futile.

                Cheers,
                NC

                Comment

                • Jerry Stuckle

                  #9
                  Re: Parse .cfm files

                  Chung Leong wrote:
                  Jerry Stuckle wrote:
                  >
                  >>Chung Leong wrote:
                  >>
                  >>>Jerry Stuckle wrote:
                  >>>
                  >>>
                  >>>>But .cfm is a Cold Fusion template file. Why would you have php code in it?
                  >>>>
                  >>>>You'll be much better off in the long run if you change the extension to
                  >>>>something standard like .php. Or just get yourself a virtual private
                  >>>>server where you can do anything you want.
                  >>>
                  >>>
                  >>>My guess is that the OP needs to preserve the URLs in existing links.
                  >>>This is probably better handled through Apache rewrite than changing
                  >>>the file extension of the source files.
                  >>>
                  >>
                  >>A 301 redirect takes care of things quite nicely - and permanently.
                  >>
                  >>--
                  >>============= =====
                  >>Remove the "x" from my email address
                  >>Jerry Stuckle
                  >>JDS Computer Training Corp.
                  >>jstucklex@att global.net
                  >>============= =====
                  >
                  >
                  One would use rewrite to do that, naturally.
                  >
                  You can use a rewrite. But a redirect will allow the search engines to
                  pick up the change without affecting current page rank. So eventually
                  you can get rid of your redirects.

                  If you just do a rewrite no one will know it's actually changed.

                  --
                  =============== ===
                  Remove the "x" from my email address
                  Jerry Stuckle
                  JDS Computer Training Corp.
                  jstucklex@attgl obal.net
                  =============== ===

                  Comment

                  • Chung Leong

                    #10
                    Re: Parse .cfm files


                    Jerry Stuckle wrote:
                    Chung Leong wrote:
                    Jerry Stuckle wrote:
                    >Chung Leong wrote:
                    >
                    >>Jerry Stuckle wrote:
                    >>
                    >>
                    >>>But .cfm is a Cold Fusion template file. Why would you have php code in it?
                    >>>
                    >>>You'll be much better off in the long run if you change the extension to
                    >>>something standard like .php. Or just get yourself a virtual private
                    >>>server where you can do anything you want.
                    >>
                    >>
                    >>My guess is that the OP needs to preserve the URLs in existing links.
                    >>This is probably better handled through Apache rewrite than changing
                    >>the file extension of the source files.
                    >>
                    >
                    >A 301 redirect takes care of things quite nicely - and permanently.
                    >
                    >--
                    >============== ====
                    >Remove the "x" from my email address
                    >Jerry Stuckle
                    >JDS Computer Training Corp.
                    >jstucklex@attg lobal.net
                    >============== ====

                    One would use rewrite to do that, naturally.
                    >
                    You can use a rewrite. But a redirect will allow the search engines to
                    pick up the change without affecting current page rank. So eventually
                    you can get rid of your redirects.
                    The easiest way to perform the redirection is with a rewrite rule, with
                    the R=301 flag.

                    See http://httpd.apache.org/docs/2.0/mod...ml#rewriterule

                    Comment

                    • Jerry Stuckle

                      #11
                      Re: Parse .cfm files

                      Chung Leong wrote:
                      Jerry Stuckle wrote:
                      >
                      >>Chung Leong wrote:
                      >>
                      >>>Jerry Stuckle wrote:
                      >>>
                      >>>
                      >>>>Chung Leong wrote:
                      >>>>
                      >>>>
                      >>>>>Jerry Stuckle wrote:
                      >>>>>
                      >>>>>
                      >>>>>
                      >>>>>>But .cfm is a Cold Fusion template file. Why would you have php code in it?
                      >>>>>>
                      >>>>>>You'll be much better off in the long run if you change the extension to
                      >>>>>>somethi ng standard like .php. Or just get yourself a virtual private
                      >>>>>>server where you can do anything you want.
                      >>>>>
                      >>>>>
                      >>>>>My guess is that the OP needs to preserve the URLs in existing links.
                      >>>>>This is probably better handled through Apache rewrite than changing
                      >>>>>the file extension of the source files.
                      >>>>>
                      >>>>
                      >>>>A 301 redirect takes care of things quite nicely - and permanently.
                      >>>>
                      >>>>--
                      >>>>=========== =======
                      >>>>Remove the "x" from my email address
                      >>>>Jerry Stuckle
                      >>>>JDS Computer Training Corp.
                      >>>>jstucklex@a ttglobal.net
                      >>>>=========== =======
                      >>>
                      >>>
                      >>>One would use rewrite to do that, naturally.
                      >>>
                      >>
                      >>You can use a rewrite. But a redirect will allow the search engines to
                      >>pick up the change without affecting current page rank. So eventually
                      >>you can get rid of your redirects.
                      >
                      >
                      The easiest way to perform the redirection is with a rewrite rule, with
                      the R=301 flag.
                      >
                      See http://httpd.apache.org/docs/2.0/mod...ml#rewriterule
                      >
                      True. You can use a rewrite to do a 301 redirect.

                      But not all rewrites are 301 redirects. A key point here.

                      --
                      =============== ===
                      Remove the "x" from my email address
                      Jerry Stuckle
                      JDS Computer Training Corp.
                      jstucklex@attgl obal.net
                      =============== ===

                      Comment

                      • Matthew256

                        #12
                        Re: Parse .cfm files

                        I've heard that Google looks at a 301 redirect as the same as a link
                        from the .cfm page to the .php page.
                        Is this correct?

                        Matthew

                        On Oct 30, 1:48 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
                        Chung Leong wrote:
                        Jerry Stuckle wrote:
                        >
                        >Chung Leong wrote:
                        >
                        >>Jerry Stuckle wrote:
                        >
                        >>>But .cfm is a Cold Fusion template file. Why would you have php code in it?
                        >
                        >>>You'll be much better off in the long run if you change the extension to
                        >>>something standard like .php. Or just get yourself a virtual private
                        >>>server where you can do anything you want.
                        >
                        >>My guess is that the OP needs to preserve the URLs in existing links.
                        >>This is probably better handled through Apache rewrite than changing
                        >>the file extension of the source files.
                        >
                        >A 301 redirect takes care of things quite nicely - and permanently.
                        >
                        >--
                        >============== ====
                        >Remove the "x" from my email address
                        >Jerry Stuckle
                        >JDS Computer Training Corp.
                        >jstuck...@attg lobal.net
                        >============== ====
                        >
                        One would use rewrite to do that, naturally.You can use a rewrite. But a redirect will allow the search engines to
                        pick up the change without affecting current page rank. So eventually
                        you can get rid of your redirects.
                        >
                        If you just do a rewrite no one will know it's actually changed.
                        >
                        --
                        =============== ===
                        Remove the "x" from my email address
                        Jerry Stuckle
                        JDS Computer Training Corp.
                        jstuck...@attgl obal.net
                        =============== ===

                        Comment

                        • Matthew256

                          #13
                          Re: Parse .cfm files

                          I've created the .htaccess file in my root directory.
                          However, this doesn't seem to work properly:


                          Matthew

                          On Oct 29, 7:14 pm, "Joel Parish" <joel.par...@gm ail.comwrote:
                          Add the following line to the .htaccess file in the directory (If there
                          is one, if not create it)
                          >
                          AddType application/x-httpd-php .php .cfm #add any other extentions
                          you want to be parsed
                          >
                          Hope this helps,
                          --Joel
                          On Oct 29, 1:53 pm, "Matthew256 " <PRESENT...@gma il.comwrote:
                          >
                          I have a bunch of files with the extension .cfm with PHP code in them.
                          It's a long story, but I need to keep the extension the same.
                          Is there a way to make PHP parse the .cfm file?
                          My web host says they can't do it on their end.
                          Should I argue?
                          >
                          Matthew

                          Comment

                          • Jerry Stuckle

                            #14
                            Re: Parse .cfm files

                            Matthew256 wrote:
                            I've heard that Google looks at a 301 redirect as the same as a link
                            from the .cfm page to the .php page.
                            Is this correct?
                            >
                            Matthew
                            >
                            On Oct 30, 1:48 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
                            >
                            >>Chung Leong wrote:
                            >>
                            >>>Jerry Stuckle wrote:
                            >>
                            >>>>Chung Leong wrote:
                            >>
                            >>>>>Jerry Stuckle wrote:
                            >>
                            >>>>>>But .cfm is a Cold Fusion template file. Why would you have php code in it?
                            >>
                            >>>>>>You'll be much better off in the long run if you change the extension to
                            >>>>>>somethi ng standard like .php. Or just get yourself a virtual private
                            >>>>>>server where you can do anything you want.
                            >>
                            >>>>>My guess is that the OP needs to preserve the URLs in existing links.
                            >>>>>This is probably better handled through Apache rewrite than changing
                            >>>>>the file extension of the source files.
                            >>
                            >>>>A 301 redirect takes care of things quite nicely - and permanently.
                            >>
                            >>>>--
                            >>>>=========== =======
                            >>>>Remove the "x" from my email address
                            >>>>Jerry Stuckle
                            >>>>JDS Computer Training Corp.
                            >>>>jstuck...@a ttglobal.net
                            >>>>=========== =======
                            >>
                            >>>One would use rewrite to do that, naturally.You can use a rewrite. But a redirect will allow the search engines to
                            >>
                            >>pick up the change without affecting current page rank. So eventually
                            >>you can get rid of your redirects.
                            >>
                            >>If you just do a rewrite no one will know it's actually changed.
                            >>
                            >>--
                            >>============= =====
                            >>Remove the "x" from my email address
                            >>Jerry Stuckle
                            >>JDS Computer Training Corp.
                            >>jstuck...@att global.net
                            >>============= =====
                            >
                            >
                            No. 301 is a permanent redirect. Google effectively replaces the page.

                            --
                            =============== ===
                            Remove the "x" from my email address
                            Jerry Stuckle
                            JDS Computer Training Corp.
                            jstucklex@attgl obal.net
                            =============== ===

                            Comment

                            Working...