Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

How to override 'localhost' and/or 'domain' definitions?

edited June 2011 in Vanilla 2.0 - 2.8
I've got an vanilla installation all set up and running.

However the server that hosts it, is inside my institution and although I can (finally) access the forum fine from outside the LAN. When I get the forum emails, the links attached there, for instance, the ones pertaining member approval I (they) receive have something like this:

http://LOCALHOST/forum/entry/signin?Target=categories/all

whereas LOCALHOST is replaced by the internal IP of the machine actually hosting the forum, and not domain to which the gateway machine actually answers as in:

http://EXAMPLE.COM/forum/entry/signin?Target=categories/all

which is the behavior I would like it to have.

I'm quite un-savvy in the matter, but still I've tried a little fiddling with config.php and also library/core/class.url.php but with not much luck...

So, is there any configuration option or otherwise simple option that allows me to override that capture of the IP as LOCALHOST so as to replace it with the EXAMPLE.COM?
Tagged:

Best Answer

  • Options
    ToddTodd Chief Product Officer Vanilla Staff
    Answer ✓
    You want to add the following to your config:
    $Configuration['Garden']['ExternalUrlFormat'] = 'http://EXAMPLE.COM/%s';

Answers

  • Options
    ToddTodd Chief Product Officer Vanilla Staff
    Answer ✓
    You want to add the following to your config:
    $Configuration['Garden']['ExternalUrlFormat'] = 'http://EXAMPLE.COM/%s';
  • Options
    Thanks Tod!

    I just had to add the forum folder like so:
    $Configuration['Garden']['ExternalUrlFormat'] = 'http://EXAMPLE.COM/FORUM/%s';

    and the emails now send the correct link :)

    However, I've noticed that when posting inside the LAN, the EXAMPLE.COM reverts to a IP, so if I don't have the local proxy added to the bypass proxy exceptions, it fails.

    Then I've tried to login in/post from outside the LAN (tested it via a webproxy) this reversal problem didn't seem to occur... BUT

    ...now I've just asked one of the users to (that I know is outside of the LAN) to post something, and that EXAMPLE.COM -> IP change happened :( but still the post got through...
Sign In or Register to comment.