RE: [PHP-DB] using php and mysql with images
| From: | Nicolas Marchildon | Date: | Sat, 01 Jul 2000 00:59:01 +0000 |
| Subject: | RE: [PHP-DB] using php and mysql with images | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-797@lists.php.net to get a copy of this message | ||
> There is a technique using ForceType and <Location> in you httpd
> configuration files so you don't have to have the .php in the
> program.
I read about that on phpbuilder.com. It's talking about search engine
indexing.
http://www.phpbuilder.com/columns/tim20000526.php3
Quote:
----------------------------------------------------------
To pull this off, I started with a subtle Apache feature that can "force"
a script to be called for any certain directory tree. In my case, I wanted
all URLs that fall under "/local/" to call a script. This would be MUCH
easier than creating 200,000 localized web pages and a genuine directory
structure to match it.
So in Apache's httpd.conf file, I added the following lines:
<Location /local>
ForceType application/x-httpd-php3
</Location>
This forces every request that starts with "/local/" to call a script
called "local" (just "local", not "local.php3") in the
$DOCUMENT_ROOT (usually called "/htdocs/") of your server. "local" then
uses PHP to parse the URL and act
accordingly. The code for my "local" script is on the last page of this
article. You can of course replace "local" with any filename you want, as
long as you change your httpd.conf accordingly.
Now if you don't have access to your httpd.conf file, you can also try the
<files > directive in a .htaccess file. Hundreds of people ran into this
stumbling block in the past 16 months. It appears that this method only
works on Linux, as people are reporting trouble on FreeBSD and Windows. If
you find an .htaccess solution on Windows, let me know.
Sample .htaccess file:
<Files local>
ForceType application/x-httpd-php3
</Files>