"Stromboli" <stromboli2 RemoveThis @hotpop.com> schreef in bericht
news:7096359e.0410101614.440c7a29@posting.google.com...
> > RewriteMap decode int:escape
> > RewriteRule (.*) /search\.cgi?query=${decode:$1} [QSA]
> >
> > Don't think you need the PTflag and added QSA to allow
<font color=green> > > <a style='text-decoration: underline;' href="http://host/emilie%20simon?tst=1</font" target="_blank">http://host/emilie%20simon?tst=1</font</a>>
> > to be passed as
<font color=green> > > <a style='text-decoration: underline;' href="http://host/search.cgi?query=emilie%20simon&tst=1</font" target="_blank">http://host/search.cgi?query=emilie%20simon&tst=1</font</a>>
> >
> > Don't forget to setup rewrite logging and to observe its writings. If
things
> > don't work out, do copy and past a few lines of it in your next post.
> I put it in the VirtualHost content. It worked!
As in any %nn comes as we hooped for? Great!
> But now when I call other scripts in the cgi-bin, instead of calling
> them, it calls the search.cgi.
Yep, it interferes in any and all requests. It should even temper a request
for index.html
> Is there any way to avoid rewrite to reconstruct sentences like
> myhost.com/cgi-bin?
Sure, just add above the RewriteRule
RewriteCond %{REQUEST_URI} !^/(cgi-bin|sample|sample2)/
This will keep the RewriteRule from changing requests involving either of
the three folders listed.
Adding
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
instead, should keep the rule from acting on any request for an existing
file or folder.
However, performance wise it might be better to reserve a foldername, like
'lookingfor', for request to be altered by just changing the rule a little:
RewriteRule /lookingfor/(.*) /search\.cgi?query=${decode:$1}
[QSA]
Finally good readings start at
<a style='text-decoration: underline;' href="http://httpd.apache.org/docs-2.1/mod/mod_rewrite.html" target="_blank">http://httpd.apache.org/docs-2.1/mod/mod_rewrite.html</a>
HansH<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: Trying to build a similar request than A9's. - rewrite new..