You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Rick van Vliet <ri...@rickvanvliet.com> on 2004/03/21 19:27:23 UTC

[users@httpd] Can PHP files load without extension?

Apache 2.048 PHP  4.3.4

Is there a setting in apache 2.048 httpd.conf file that will allow a php 
page to load, without needing to supply the extension?
I have my DirectoryIndex set to take care of "index.php" automatically, 
but I would like to be able to have a php file load, as though it were an 
htm or html.

I though I was able to do this with Apache 1.3x, and php 4.32, but I 
cannot seem to find anything googling or at apache.org, where this is very 
clear.

Thanks,
rick

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Can PHP files load without extension?

Posted by Didier Peereboom Voller <di...@simpelinternet.nl>.
yes this is possible

AddType application/x-httpd-php 

Is the line where you tell apache that it should handle for instance
*.php as a php file. *.php3 *.phtml *.php4 are typical but it is really
up to you.

You can simply add any extension you want. Possibly even * if you are
adventurous. 

I did *.jpeg once (all real images where *.jpg) and this allowed me to
serve the images from a php script and do a little bit of scripting
magic while it still looked like a regular image link.

Just be beware of making a mistake and getting php to parse a binary
file. Also make sure in my *.jpeg example the only output is a jpeg
image (headers too) or you may get some very confused browsers.

Didier

On Sun, 2004-03-21 at 19:27, Rick van Vliet wrote:
> Apache 2.048 PHP  4.3.4
> 
> Is there a setting in apache 2.048 httpd.conf file that will allow a php 
> page to load, without needing to supply the extension?
> I have my DirectoryIndex set to take care of "index.php" automatically, 
> but I would like to be able to have a php file load, as though it were an 
> htm or html.
> 
> I though I was able to do this with Apache 1.3x, and php 4.32, but I 
> cannot seem to find anything googling or at apache.org, where this is very 
> clear.
> 
> Thanks,
> rick
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org