重定向直接图像URL请求并在重定向中传递原始URL值

Suppose I have someone (or Google Images) trying to access

http://null.com/uploads/someimage.jpg (actually any image in /uploads folder)

I'd want htaccess to redirect the user to

http://null.com/page/

HOWEVER, I need to pass the original url (http://null.com/uploads/someimage.jpg) to the redirection target page as a POST string value which the target php page can use to do stuff with it

Would it be possible to achieve that with htaccess?

UPDATE - and also, it would be interesting to have this working only when the user agent is a human operated browser, not a bot such as google bot, in this way Google and other search engines can crawl images appropriately without the redirection

You may try this:

Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !page\.php           [NC]
RewriteCond %{REQUEST_URI} ^/uploads/([^/]+)/?  [NC]
RewriteRule .  page.php?url=uploads/%1 [L]

Maps silently

http://null.com/uploads/someimage.jpg with or without trailing slash

To:

http://null.com/page.php?url=uploads/someimage.jpg

The string uploads is assumed to be fixed, while someimage.jpg can be any name.

The script name page.php is an example an can be any name also. Replace all instances in the rule-set.

For permanent and visible redirection, replace [L] with [R=301,L]

This answer is according to this description in OP comments:

"...redirect the user to this page and pass the former original url as a post value..."

where page is a script.

NOTE: The parameters passed in the substitution URL can be captured with PHP using $_GET or $_REQUEST, not $_POST.

UPDATE

Here is another version:

Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !page\.php        [NC]
RewriteRule ^(.*)\.jpg   page.php?url=$1.jpg [L]

Maps silently

http://null.com/any/number/of/folders/someimage.jpg

To:

http://null.com/page.php?url=any/number/of/folders/someimage.jpg

The rewrite rule is applied only when the incoming URL holds a file with extension jpg at the end of the path.