Extensions other than .php

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

    Extensions other than .php

    I'm trying to create a .txt file on my server that will log the IP,
    user agent, and referrer of people who access it, and send back
    different contents based on the user agent. The file has to have the
    ..txt extension because there are already links to the file on other web
    sites where I can't change the link URL. Is it possible to have PHP
    interpret files with extensions other than .php?
    It would also be useful for finding out when other sites refer to files
    on my server instead of copying the file to their server.

  • Andy Hassall

    #2
    Re: Extensions other than .php

    On 27 May 2005 13:12:45 -0700, "DJ Craig" <spit@djtriciti es.com> wrote:
    [color=blue]
    >I'm trying to create a .txt file on my server that will log the IP,
    >user agent, and referrer of people who access it, and send back
    >different contents based on the user agent. The file has to have the
    >.txt extension because there are already links to the file on other web
    >sites where I can't change the link URL. Is it possible to have PHP
    >interpret files with extensions other than .php?
    >It would also be useful for finding out when other sites refer to files
    >on my server instead of copying the file to their server.[/color]

    It's a webserver configuration issue, not PHP. Which are you running?

    --
    Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • Mladen Gogala

      #3
      Re: Extensions other than .php

      On Fri, 27 May 2005 13:12:45 -0700, DJ Craig wrote:
      [color=blue]
      > I'm trying to create a .txt file on my server that will log the IP,
      > user agent, and referrer of people who access it, and send back
      > different contents based on the user agent. The file has to have the
      > .txt extension because there are already links to the file on other web
      > sites where I can't change the link URL. Is it possible to have PHP
      > interpret files with extensions other than .php?
      > It would also be useful for finding out when other sites refer to files
      > on my server instead of copying the file to their server.[/color]

      For Apache2 server you should put

      AddType application/x-httpd-php .txt

      into your httpd.conf.




      --
      Demagogue: One who preaches a doctrine he knows to be untrue to
      men he knows to be idiots.
      H.L. Mencken

      Comment

      • ECRIA Public Mail Buffer

        #4
        Re: Extensions other than .php

        A better way would be to use Apache's mod_rewrite.



        ECRIA



        Comment

        • John Dunlop

          #5
          Re: Extensions other than .php

          Mladen Gogala wrote:
          [color=blue]
          > For Apache2 server you should put
          >
          > AddType application/x-httpd-php .txt[/color]

          how come you don't stick with the conventional <.php> in
          filenames?

          --
          Jock

          Comment

          • Mladen Gogala

            #6
            Re: Extensions other than .php

            On Sun, 29 May 2005 18:08:38 +0000, John Dunlop wrote:
            [color=blue]
            > Mladen Gogala wrote:
            >[color=green]
            >> For Apache2 server you should put
            >>
            >> AddType application/x-httpd-php .txt[/color]
            >
            > how come you don't stick with the conventional <.php> in
            > filenames?[/color]

            I do stick with ".php". I just answered the original poster's question.
            I have no idea why would one do a thing like that, but he asked the
            question.

            --
            Demagogue: One who preaches a doctrine he knows to be untrue to
            men he knows to be idiots.
            H.L. Mencken

            Comment

            • John Dunlop

              #7
              Re: Extensions other than .php

              Mladen Gogala wrote:
              [color=blue]
              > I have no idea why would one do a thing like that, but he asked the
              > question.[/color]

              don't you want to know why?

              --
              Jock

              Comment

              • DJ Craig

                #8
                Re: Extensions other than .php

                I'm using Linux. Heres that it says when I type uname -a:
                Linux imhip11.aitcom. net 2.4.26 #2 SMP Fri Jul 9 18:41:20 EDT 2004 i686
                unknown
                I'm using Apache. Not sure what version. How do I find out?

                Comment

                Working...