I've got a site where I want to allow the user to go to either http://www.foo.com/ or https://www.foo.com/ and be bounced to https:://www.foo.com/cgi-bin/login.cgi. Initially, I was doing this using index.html files that looked something like:
<html>
<head>
<title>www.foo.com Redirect</title>
<meta
http-equiv='refresh'
content='1;URL=/cgi-bin/login.cgi'
>
</head>
</html>
I just read merlyn's column on using 404 as a cache builder. So, I tried out using 403 (cause I have indexing off) and it worked. But, I am uneasy at the fact I seem to be hacking out a solution.
Also, without hard-coding the servername, I don't see a way of getting from within the *:80 virtualhost to the *:443 virtualhost. I mean, using
ErrorDocument 403 https://www.foo.com/cgi-bin/login.cgi
would work, but doesn't it defeat the point of named virtual-hosting? (Or, am I blathering?)
Another concern I have is that does this introduce any issues? I don't mind having every Forbidden query bounce to my login screen for both the :80 and :443 ports. Is there anything else?
------
We are the carpenters and bricklayers of the Information Age.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
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.