Hello Monks,

Ok, i'm sure i'm just having a brain fart OR its simply not possible to do what i'm trying. The redirect simply doesn't happen with either IE9, Google Chrome or FireFox. So I suspect its a limitation that a page can't redirect?

I'm trying to redirect to index.shtml if the user requests the welcome page without being authorized first. The same redirect method works when delivered from a perl script directly

My welcomeV01.pl simply contains this:

my $URL = "http://localhost/index.shtml"; print "Status: 302 Found\n"; print "Location: $URL\n\n"; exit;

My welcome.shtml page simply contains this:

<!--#include virtual="/cgi-bin/welcomeV01.pl"-->

Thank-you kindly in advance :) *bow*

(Apache server, no errors in logs, perl is functional as i'm using it for other scripts on the same server)

SOLUTION: After a couple hours of searching google for more info on methods of accomplishing this, the idea popped into my head to use .htaccess ModRewrite to redirect all calls to welcome.shtml, directly to the welcome.pl script instead. It is working thus far, allowing me to supply content based on the client being authorized

Necessary .htaccess file changes: RewriteEngine on RewriteRule welcome.shtml /cgi-bin/welcomeV01.pl [L] Perl file code: my $URL = "http://localhost/index.shtml"; print "Status: 302 Found\n"; print "Location: $URL\r\n\r\n"; exit;

Thank-you very much for your help Monks, asking the questions here allowed me to break my thought cycle and move forward

There isn't in existence

In reply to HTTP Redirect from SHTML page by Inexistence

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.