Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are currently building on a domain that was previously used by someone else. We have managed to 301 redirect everything except for one page:

I have tried redirecting everything from the cgi-bin directory using htaccess in addition to putting the htaccess in the cgi-bin directory (which is outside of the httpdocs directory) to no avail. Currently running on media temple server. Is there a permission I need to set to access that folder with the htaccess? Use something else? I don't want to use any cgi, just get it back to my home page.

Thanks in advance!

share|improve this question

If you have access to the config for your virtual host:

Redirect 301 /cgi-bin/link.cgi

If you don't have access to the configuration for your virtual host, then you're probably out of luck since your web server config is likely to contain something like this:

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride None

...which means that .htaccess files will be ignored in the cgi-bin directory...

As a last resort, you might try stuffing the following into link.cgi:


print "Location:\n\n";
share|improve this answer
thank you for your response. I created the link.cgi and have the header redirect to the home page although my browsers do not even recognize that the link.cgi is in the folder (i put one in the cgi-bin/ in the root as well as created a directory named cgi-bin in the httpdocs) i tried using the above code so that is the only thing in the cgi file right now. Is that enough to make up a cgi file? Thank you again – Jon Jan 25 '11 at 20:43

Why not just modify the actual CGI file to redirect, either with HTML meta tags or otherwise?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.