I'm trying to set up a dynamic open source site, and I have the following idea:
For any page root:/dir/file.php, going to root:/txt/dir/file.php will show the source code without running it, i.e. a rewrite triggers a ForceType to text/plain.
Individually, I could handle each of these, but I don't know how to do them together.
Don't worry specifically about images etc being affected by the rewrite - users should never try /txt/path/to.jpg and if they do it'll be no benefit to them.
I also hide passwords and intentionally hidden data in .htaccess protected files so I don't think people will be able to steal anything sensitive.
Could you also tell me if this isn't posible, or even should be but you don't know how. That way I can stop wasting time looking for something that can't be achieved and get on with more vital areas.