Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

run php files without the .php extension

Status
Not open for further replies.

dennis99

MIS
Apr 22, 2002
9
GB
Hi,

How can I tell apche that if I put this url in the browser
.../go/12/13/
(there is no directory called 12 or 13 only a go.php file)
that it should run the file called go.php

right now it works if I put .../go.php/12/13/

But I want it to look for .php files by itself

Do I need to add any modules for it to work ?

Thank you
 
You might need to have the mod_spelling driver installed. It will allow you to write go instead of go.php and it should resolve to go.php. It acts as a corrector, if you misspell something it will look for the closest thing to resolve to (which would be go.php).


Hope This helps!!!

Rninja Rninja

smlogo.gif

 
Hi,

You can associate extensions with php via a AddType directive in srm.conf (or directly in httpd.conf if you have a 'ResourceConfig /dev/null' in httpd.conf). For example :

AddType application/x-httpd-php .php .php4 .php3

Not sure if you can do '.' though...

Rgds
 
As Dennis99 said, I was able to access a PHP script the same way, and I also do not have mod_speling setup. I am researching now to see which module is responsible for this. My currently loaded modules are:

mod_ssl, mod_php4, mod_setenvif, mod_so, mod_unique_id, mod_usertrack, mod_headers, mod_expires, mod_cern_meta, mod_digest, mod_auth_anon, mod_auth, mod_access, mod_rewrite, mod_alias, mod_userdir, mod_actions, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_info, mod_status, mod_negotiation, mod_mime, mod_mime_magic, mod_log_config, mod_define, mod_env, mod_vhost_alias, http_core

And this machine has PHP-4.0.6/Apache 1.3.19

I don't think it is one of the following, because it doesn't work on another machine with these loaded:

mod_php4, mod_setenvif, mod_auth, mod_access, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core

this machine has PHP-4.0.1/Apache 1.3.12
 
Thanks, maybe its the mod_mime_magic that does the magic :)

My system is Apache 1.3.20
PHP 4.06 on Linux.

Cheers
Dennis

 
It is fixed now, I found an old http.conf an used that and now it works !

I'm not sure why, I don't load any extra modules from the http.conf file, I'm investigating what it is that does it.

For anyone interested these are the modules I have loaded:

mod_php4, mod_setenvif, mod_so, mod_auth, mod_access, mod_rewrite, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core


Cheers
Dennis
 
I think it's the multiviews option that does it, from the Apache Manual :
MultiViews
A MultiViews search is enabled by the MultiViews Option. If the server receives a request for /some/dir/foo and /some/dir/foo does not exist, then the server reads the directory looking for all files named foo.*, and effectively fakes up a type map which names all those files, assigning them the same media types and content-encodings it would have if the client had asked for one of them by name. It then chooses the best match to the client's requirements, and returns that document.

Dennis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top