On 2018-01-01, Jordon <[email protected]> wrote:
> Over the last few days I have been learning the BCHS approach at web design.
> I am not a web designer (i had to learn CSS as part of this!) but have
> enjoyed this little adventure. My goal was to make an web interface to view
> data that i provide in a c++ library and so far i have been pretty successful.
> In doing some cleaning up and reorganizing, i have renamed the cgi program.
> I thought it would be nice to create a shell script with the old name that
> would spit out a simple page saying the name changed and providing a link to
> the new cgi app. I made the shell script but for the life of me cannot get
> it to work. Is this allowed/supported in httpd? If so, any idea what I
> could be missing?
I think you might want something along the lines of "location /old/path.cgi
{ block return 301 https://hostname/new/path.cgi?$QUERY_STRING }" in httpd.conf.
If you're interested in why the shell script doesn't work, start by running
it manually inside the chroot jail and see what it says, e.g.
# chroot /var/www /var/www/cgi-bin/script.cgi