Tricky mod_rewrite for clean urls problems when fetching external sources

Hi, I have problems with mod rewrite. I will try to describe...

I want clean urls but fail to make it work propperly. Maybe I have problems, because the content displayed is fetched from my other site...

There is a lot of stuff I already red about this, but somehow I can not find a solution for this:

Site 1 is used to fetch images for displaying on several other sites.

For example if I want to show a specific category the url is:

http://www example1.com/show.php/tag=flower+red

To view these flowers on an other site, I use some php code like this, what works wonderful for this "dirty urls":

$url="$url1".substr(getenv('REQUEST_URI'),1);
$postdata = "$url1";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);

So on the 2. Site this shows me the same flowers as requested on the url above.

http://www example2.com/show.php/tag=flower+red

But I need this request from the 2.Example-Site with clean urls. Like this:

http://www example2.com/flower+red/

In .htaccess if the 2.Site I added this to make it work, but it fails:

RewriteEngine On
RewriteRule ^([^/]*)/$ /show.php?tags=$1 [L]

From all I undertand from all this mod_rewrite, the following request should be the same:

http://www example2.com/flower+red/

=

http://www example2.com/show.php/tag=flower+red

But the request, which goes to site1 in this example is:

http://www example1.com/flower+red/

Why doesn't site2 rewrite this request propperly first to the "dirty url"?

I am on my mobile phone so I can't see clearly. My first impression is that you need to return a 301 to get the redirect you are looking for,

---------- Post updated at 16:10 ---------- Previous update was at 13:43 ----------

OK, I checked this and your regex is not matching properly, but I can't tell from your post exactly what you want to match (and not want to match).

Please provide clear examples of the exact URIs you want to match and exactly what you want to replace with. Thanks.

---------- Post updated at 16:14 ---------- Previous update was at 16:10 ----------

On second thought, I can't answer because I can't understand your original question very well, sorry!

I think the problem is that

substr(getenv('REQUEST_URI')

is not rewritten back to

show.php/tag=flower+red