(Answer) (Category) Faq-O-Matic Faq-O-Matic : (Category) Administrators' Guide : (Category) Suggestions :
Only use absolute URL when a base URL is specified
Currently FAQ-O-Matic forces the use of full URL's even when the $serverBase variable is not set. The drawback to using this approach is that if you are remotely logged in using ssh and using port forwarding to view your internal only website, FAQ-O-Matic presents URL's that are unresolvable through this private connection. A better approach (for ssh) would be to not force complete URL's, but to rather let the server find it. If you wanted the other kind of behavior then use the $serverBase variable. Here is my hack to get this to work. BTW, it works quite well.

Edit Omatic.pm functions serverBase and cgiURL starting at line 365 (Version 2.709)
Edit this line

 if (defined($FAQ::OMatic::Config::serverBase)
        && $FAQ::OMatic::Config::serverBase ne '') {
        return $FAQ::OMatic::Config::serverBase;
 }
and remove the ne part of the test so that you have this instead
 if (defined($FAQ::OMatic::Config::serverBase)) {
        return $FAQ::OMatic::Config::serverBase;
 }
This hack allows it to work with port forwarding in ssh with a totally internal website, no https needed, nor the trouble or difficulty of installing it. Be sure to make the edit to the cgiURL subroutine as well.
Change this
 if (defined($FAQ::OMatic::Config::cgiURL)
        && $FAQ::OMatic::Config::cgiURL ne '') {
        return $FAQ::OMatic::Config::cgiURL;
 }
to this
 if (defined($FAQ::OMatic::Config::cgiURL)) {
        return $FAQ::OMatic::Config::cgiURL;
 }



[Append to This Answer]
Previous: (Answer) HTML Links on invalid HTML code
Next: (Answer) Create glossary for cross-references
This document is: http://www.jonh.net/cgi-bin/faqomatic/fom?file=789
[Search] [Appearance]
This is a Faq-O-Matic 2.718d.
Hosted by SourceForge Logo and jonh.net.