RE: [PHP] Win 98 Apache - Directory style Query Strings on PHP Fi les without extensions

From: Date: Tue, 15 Oct 2002 16:09:17 +0000
Subject: RE: [PHP] Win 98 Apache - Directory style Query Strings on PHP Fi les without extensions
Groups: php.general 
Request: Send a blank email to php-general+get-120037@lists.php.net to get a copy of this message
> -----Original Message----- > From: Andy White [mailto:andrew@intellnet.net.uk] > Sent: 15 October 2002 16:08 > To: php-general@lists.php.net > > I'm trying to allow my Apache webserver, on Win 98 to run PHP > files without > extensions. > > Where the file is "index" without an extension and "xxx" and > "yyy" are the > sections of the query string. > > Although http://www.mysite.com/ or > http://www.mysite.com/index work fine, > picking up the index file okay http://www.mysite.com/xxx/yyy/ > or > http://www.mysite.com/index/xxx/yyy/ come back with internal > server errors. > > I have set the DirectoryIndex to "index" and DefaultType to > "application/x-httpd-php" in the httpd.conf but I am at a > loss after that! I've successfully done this sort of thing in a couple of ways. For your scenario, I'd probably try this as first choice: Alias / /dir/to/scripts/index.php/ <Directory "/dir/to/scripts/"> AddType application/x-httpd-php .php </Directory> This should invisibly inject a reference to "index.php/" for all requests to your site --note that it does NOT use DefaultType. (/dir/to/scripts can be your DocumentRoot if that's where index.php is!) There are several variations on this, using AliasMatch and, yes, DefaultType in various combinations, but I'd recommend this as the simplest route to get *all* references to your site to be passed through /index.php without actually mentioning it in your URLs. Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: m.ford@lmu.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

« previous php.general (#120037) next »