This is a simple problem but I expect has a very difficult solution.
I want to have a page run some PHP code on http request, without using mod_rewrite and without using javascript.
ex. http://website.com/some_audio.mp3 when user or robot requests this link, a php script is called to process and then deny or allow the request.
I cannot use mod_rewrite for this, I know it sounds crazy just take my word for it. Also cannot use javascript either since robots would bypass this. need some kind of htaccess solution.
Telling to Apache "to interpret the file as PHP" (AddType application/x-httpd-php .mp3
) is almost the same thing as rewriting the URL so, this is not possible without using mod_rewrite or, to simplify, without making the file a PHP script. However you may type some rewrite-conditions ("something like"... not tested), but you just sayd: without rewrite
RewriteCond %{HTTP_USER_AGENT} .*Googlebot.*$ [NC]
RewriteRule ^(.+\.mp3)$ - [F,L]