Hello, I need to encrypt certain URLs included in the response sent to the client and generated from a PHP script (most of them are pdf files) For instance, the URL http://www.aaa.com/documents/file1/mydoc.pdf should become something like http://www.aaa.com/Ffdsf2332342342342342423 and the other way around; a client accessing http://www.aaa.com/Ffdsf2332342342342342423 should be redirected to http://www.aaa.com/documents/file1/mydoc.pdf How can I achieve this? I was thinking of using filters or mod_rewrite. Thanks a lot for your help
not really encrypting the data but you could for example use a random string as an access code. Have a table in the Db that shows which access keys are for what file. Once you have done this then simply have a htaccess file that converts access code into a variable and pass it into another file that handles the pushing of the file. This method ensures the person does not know the url of the file as they are going through a secondary file with no forwarding taking place (if you use do as you originally planned they could just look at the headers the browser receives and know the proper address)
Thanks for your reply coffear. The problem is that this solution does not handle the following case... the URL http://www.aaa.com/documents/file1/mydoc.pdf should become something like http://www.aaa.com/Ffdsf2332342342342342423 I cannot rewrite the PHP files to include the new URL; there are hundreds of them. Thats why I was thinking of creating a filter