Re: Apache 1.3x/PHP 5.0.3 404 error handler & posted data...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux