473,385 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.

Jul 17 '05 #1
7 1341
On 27 May 2005 13:12:45 -0700, "DJ Craig" <sp**@djtricities.com> wrote:
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.


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

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
On Fri, 27 May 2005 13:12:45 -0700, DJ Craig wrote:
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.


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

Jul 17 '05 #3
A better way would be to use Apache's mod_rewrite.

http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html

ECRIA
http://www.ecria.com
Jul 17 '05 #4
Mladen Gogala wrote:
For Apache2 server you should put

AddType application/x-httpd-php .txt


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

--
Jock
Jul 17 '05 #5
On Sun, 29 May 2005 18:08:38 +0000, John Dunlop wrote:
Mladen Gogala wrote:
For Apache2 server you should put

AddType application/x-httpd-php .txt


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


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

Jul 17 '05 #6
Mladen Gogala wrote:
I have no idea why would one do a thing like that, but he asked the
question.


don't you want to know why?

--
Jock
Jul 17 '05 #7
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?

Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: George Adams | last post by:
I like the idea of compiling DSO modules for Apache. It allows me to turn on or off things we may or may not need at a given time (like mod_ssl, mod_auth_mysql, mod_auth_ldap, etc.) and also...
3
by: Martin Lucas-Smith | last post by:
Is there some way of using ereg to detect when certain filename extensions are supplied and to return false if so, WITHOUT using the ! operator before ereg () ? I have an API that allows as an...
0
by: User1001 | last post by:
I have been trying to enable/use specific OpenSSL extensions that I use in generating certificates manually, via PHP5 + php5-openssl module/extension. Filling out the "configargs" array with...
30
by: Jive | last post by:
Can someone explain to me why Python 2.4 on MS Windows has these backward compatibility problems? What am I missing? Why won't extensions compiled to run with 2.3 also work with 2.4? Why does it...
27
by: jacob navia | last post by:
Has anyone here any information about how arrays can be formatted with printf? I mean something besides the usual formatting of each element in a loop. I remember that Trio printf had some...
4
by: Lee Forst | last post by:
What is all required to run an ASP.NET application on an IIS server? Of course you would need to have the .NET Framework installed, but do you have to have the ASP.NET Extensions installed? What...
3
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work...
10
by: musosdev | last post by:
Hi guys I'm trying to migrate to VS2005... I've managed to do that, but realised I'd opened my web projects as file projects, and I'm getting the error about network BIOS command limit. ...
59
by: Anando | last post by:
Hi, I have a linear singly linked list of 100 elements. I would like to prune it such that only user specified elements (say only the elements 1, 13, 78 and 100 of the original list) survive...
12
by: ARC | last post by:
I'm currently looking at the access developer extensions for creating an MSI installer package for a 2007 runtime app. Couple of observations and questions. 1) Doesn't look like we have the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.