Sometimes permissions can bite CGI execution. The folder it's in should probably be 755. The script too. You can shorten, and ever so slightly increase the speed of, the code this way-
use CGI ();
print CGI::redirect( -status => 301,
-url => "http://192.168.1.3" );
When you execute the file/script from the command line, it works, right?
moo@cow[167]~/bin>perl pm-730807-demo-code
Status: 301
Location: http://192.168.1.3
And while this is a fun exercise to play with, an easier and faster solution is to put this in the relevant .htaccess file.
redirect 301 /old http://192.168.1.3/new
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.