Since http and https are handled by different virtual-hosts on apache (due to the fact, that they listen to different ports (normaly 80 for http and 443 for https)), you have to issue a redirect to the client to accomplish this. Of course the client must be able to understand http/1.x 30x status responses and the Location header.
A common solution is to let apache do the redirecting via mod_rewrite for certain urls.
# the ssl host <VirtualHost aaa.bbb.ccc.ddd:443> [...]# ServerName etc. RewriteEngine on RewriteRule ^/cgi-bin/prog.pl(\?.*)$ http://my.server/cgi-bin/prog +.pl$1 </VirtualHost>
If you want to do the redirecting from the cgi and are using CGI.pm, read up on CGI::redirect()
Edit:fixed the redirect-target protocol.
regards,
tomte
Hlade's Law:
If you have a difficult task, give it to a lazy person --
they will find an easier way to do it.
In reply to Re: HTTP and CGI
by Tomte
in thread HTTP and CGI
by hotshot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |