Re: Apache 1.3x/PHP 5.0.3 404 error handler & posted data...
| From: | Burhan Khalid | Date: | Mon, 11 Jul 2005 07:41:25 +0000 |
| Subject: | Re: Apache 1.3x/PHP 5.0.3 404 error handler & posted data... | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-218421@lists.php.net to get a copy of this message | ||
Rasmus Lerdorf wrote:
[ snip ]
A better option may be to just use mod_rewrite. Something along the lines of: RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)\.html$ $1.php [T=application/x-httpd-php,L] You should verify this with the mod_rewrite docs, but this should only rewrite a request for whatever.html to whatever.php if whatever.html doesn't exist. I suppose you could also add a condition to only do the rewrite if $1.php exists.I tried something similar to the above. I had a directory that has sample php scripts that I use for explaining a concept. I was hoping that the following mod_rewrite would take all requests for .phps and parse them as x-httpd-php-source, but it doesn't work, as phps files are parsed as php. RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+\.php)s$ $1 [T=application/x-httpd-php-source,L] Does anyone know of a way to make this work? Is it even possible? Rasmus: A few months back you posted some Apache settings that allow one to run both php5 and php on the same Apache instance using mod_proxy (iirc). Can you please post that again? I can't seem to google for it in the archives. Thanks, Burhan