|
Posted by Lucanos on 01/26/07 01:04
Hi All,
Hoping for some direction here (I have searched, without avail, for a
solution already).
I was toying with trying to find a way whereby I could have a single
PHP file, and then specify whether to either see the processed output
or the source code by using the extensions php and phps (respectively).
So, with one file called "theFile.php" on the server, going to
"www.server.com/theFile.php" would show the end result of the php
actions, whereas going to "www.server.com/theFile.phps" would show the
actual content of the file itself.
I thought this could be done by modifying the htaccess file as follows:
AddType application/x-httpd-php-source phps
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.phps$ $1.php
However this does not work:
- if a *.php file exists, then accessing *.php or *.phps returns the
end result of the php actions.
- if a *.phps file exists, then accessing *.php returns a 404 error,
and *.phps shows the actual file contents.
Looking for any direction, references, or assistance.
Thanks
Navigation:
[Reply to this message]
|