I've been fighting the Google canonical page algorithm bug for 2+ months. Following various forum advice and suggestions haven't solved it yet, although for sure they've made our website better. One advice I've been given is to hide, or make silent, our use of a page generation Perl script, and give Google indexing only "plain URLs" with no script, no page parameters, no file extensions, etc. I don't know if that fixes it but anything is worth a try when Google indexing goes into lock mode and refuses to index your pages.
My question is: how to start with a URL and end up with the same URL, with Perl script processing in between? I thought about doing it with an .htaccess rewrite, which we already use, for example:
but then I would need to rewrite back, and that would be an .htaccess loop. Plus if the gen.pl URL were given in the first place I would not want the first rewrite.
Any and all suggestions on how to solve this welcome.