MetaChat REGISTER   ||   LOGIN   ||   IMAGES ARE OFF   ||   RECENT COMMENTS




artphoto by splunge
artphoto by TheophileEscargot
artphoto by Kronos_to_Earth
artphoto by ethylene

Home

About

Search

Archives

Mecha Wiki

Metachat Eye

Emcee

IRC Channels

IRC FAQ


 RSS


Comment Feed:

RSS

28 February 2008

Redirecting a single cgi page? [More:]Looking at the logs for my company's site, it looks like people are still trying to hit the location of the old home page. (something like /cgi-bin/category.cgi)...

The thing is, I don't really know much about cgi, and I just want to redirect visitors to this page to our home page...

I tried
#!/usr/bin/perl

print "Location: http://mywebsite.com/\n\n";
if you are using the Apache webserver this is quite easy to accomplish. Put a redirect statement in httpd.config

Redirect /cgi-bin/category.cgi /newdir/newpage.ext

See here.
posted by quonsar 28 February | 12:42
You should use Apache to redirect, as quonsar says, by either creating/editing a .htaccess file in the relevant directory, or editing httpd.conf. Redirection by the webserver itself is more efficient than doing it in CGI.

If you don't have access to .htaccess or httpd.conf and have no choice but to use Perl, then I think something like this should work:
$q = new CGI; print $q->redirect("http://www.mysite.com/");
posted by matthewr 28 February | 12:58
Thanks for the help quonsar and matthewr, the problem has been fixed.
posted by drezdn 28 February | 13:19
This song || sorry to ask, but i need urgent technical help

HOME  ||   REGISTER  ||   LOGIN