Re: File extension for PHP's serialization format?
| From: | Chris | Date: | Fri, 27 Oct 2006 01:47:43 +0000 |
| Subject: | Re: File extension for PHP's serialization format? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-243719@lists.php.net to get a copy of this message | ||
Hamish Lawson wrote:
Hello Chris Thanks for responding. But what file extension should I use for PHP's serialization format? Obviously it can't be .php - aside from being inaccurate (it's not PHP code), using this extension would probably trigger the web server into trying to run a (nonexistent) PHP script.You could "convert" it to a php file: RewriteCond %{REQUEST_URI} *.json RewriteRule ^(.*).json$ json.php?$1 [T=application/x-httpd-php,L] Might not work straight away but that should give you an idea of what's possible. -- Postgresql & php tutorials http://www.designmagick.com/You can rewrite the url using mod_rewrite or some such variant to handle this.Yes, there may well be ways to get round what the web server would otherwise do when it encounters a .php extension, but I feel that I'd be breaking an expectation. I'd much rather use an extension that was specific to the serialization format.