On Tue, 7 Oct 2008,
invalid@example.org wrote:
Quote:
There are four options available to you.
1) Try various examples you find on the web or in newsgroups
2) Spend a bunch of time learning mod_rewrite from the ground
3) Hire someone with experience to do it for you. If you don't
4) Give up. Decide that you can live without doing what you
Thanks for the very unhelpful suggestions :-(
After all I found a way to do what I wanted.
The infinite loop in going from url to index.cgi?url was NOT due to the
fact index.cgi is itself an url subject to rewriting ...
.... but to the fact index.cgi does a document.location=url redirection
itself, and therefore causes another rewrite on the target url, and
another, and another.
The way to cut that out was the following :
- I noticed that if I call a page url directly, it has an empty referer
while if I call the page through the CGI, it has a referer equal to
the same page url
- therefore this is what I put in the .htaccess
RewriteCond %{HTTP_REFERER}<->http://%{SERVER_NAME}%{REQUEST_URI} !^(.*)<->\1$
RewriteRule ^(.*).html /~lucio/temp/temp/index.cgi?$1.html [L]
so the rewrite is triggered only if the referer is NOT THE SAME as the
invoked URL.
The condition looks clumsy, because I haven't found a way to test
A==B in a RewriteCond (where both A and B are variables), but to test
that "A concatenated a separator concatenated B" is equal to
"anything concatenated a separator concatenated the same thing" ...
... but I employed the same sort of expression already
(anyhow if anybody has a simpler way of doing such test it will be
definitely welcome)
--
----------------------------------------------------------------------
nospam@mi.iasf.cnr.it is a newsreading account used by more persons to
avoid unwanted spam. Any mail returning to this address will be rejected.
Users can disclose their e-mail address in the article if they wish so.