I have a website on ipage and works fine. I am trying to migrate it to Google Cloud and the cgi-bin is duplicated when called by a form action as shown below:
http://34.28.183.10/cgi-bin/cgi-bin/list_directory_1.cgi?directory=%2CBrasil%2CMinas+Gerais&submit_trailing_directory=
It works if I remove the extra cgi-bin such as:
http://34.28.183.10/cgi-bin/list_directory_1.cgi?directory=%2CBrasil%2CMinas+Gerais&submit_trailing_directory=
I placed the script list_directory_1.cgi in /usr/lib/cgi-bin and the form whose action calls this script looks like this:
print qq(<form action="cgi-bin/list_directory_1.cgi" method="GET">\n);
The apache2 log files shows this:
[Thu Mar 16 14:39:49.939253 2023] [cgid:error] [pid 5389:tid 140165141997312] [client 107.217.8.189:52312] AH01264: script not found or unable to stat: /usr/lib/cgi-bin/cgi-bin, referer: http://34.28.183.10/cgi-bin/list_directory_1.cgi?directory=%2CBrasil&submit_directory=
A URL that starts with a relative path (like cgi-bin/list_directory_1.cgi
) is resolved by:
http://34.28.183.10/cgi-bin/list_directory_1.cgi?directory=%2CBrasil&submit_directory=
)/
in the path (http://34.28.183.10/cgi-bin/
)http://34.28.183.10/cgi-bin/cgi-bin/list_directory_1.cgi
)Use an absolute path (starting with a single /
) instead:
<form action="/cgi-bin/list_directory_1.cgi"
These are resolved by:
http://34.28.183.10/cgi-bin/list_directory_1.cgi?directory=%2CBrasil&submit_directory=
)http://34.28.183.10
)http://34.28.183.10/cgi-bin/list_directory_1.cgi
)