What is the correct path to scripts in the cgi-bin?

Asked by:
Coach / 26 Points
2012-03-06 2:35 pm EST
File Management
The situation is: cgi script A calls another cgi script B. When script B is called directly from the browser using
www.domainname/cgi-bin/script name , it works. When the same script B is called by script A using a submit button, I receive a message:link is broken. Both scripts are in /public_html/cgi-bin. The question is: when script A calls script B what path to script B should be used in script A?
Thank you so much for your help. I looked at possible articles at your Support section.

Sorry to bother you


To ask this user for more information, please first login.

To submit an answer, please login.

Best answer chosen by Web Hosting Hub staff


13,688 Points
2012-03-06 2:55 pm EST
Hi Michael,

Please do not feel that you need to apologize, it's not a bother and we are happy to help. I took a look at this for you and found the following tag in what I believe is Script A in your account:

<form action="/www.domain.com/public_html/cgi-bin/env-variables.pl" method="POST">

I adjusted that path as follows:

<form action="http://www.domain.com/cgi-bin/env-variables.pl" method="POST">

When you link to a file through the full URL (http://domain.com) the public_html directory should not be listed in the path. When you navigate to a domain, you are already in the public_html directory.

You could also edit that tag and use the following root relative path:

<form action="/cgi-bin/env-variables.pl" method="POST">

While looking into this for you I noticed that there are some scripts in your cgi-bin that have file permissions set to 644. Please make sure that scripts in the cgi-bin have permissions set to 755.

If you have any additional questions or need further assistance, please do not hesitate to contact us.


Christi N.

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.