diff options
author | Badlop <badlop@process-one.net> | 2015-07-15 20:45:55 +0200 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2015-07-15 20:45:55 +0200 |
commit | c53d764119dc90f4e643c334e6603b3e452d1757 (patch) | |
tree | bcfa60e6b5df5933f31a03730ab9cd35aa883e3b /src/ejabberd_web_admin.erl | |
parent | Update links to Guide in WebAdmin (diff) |
If local guide.html file not found, redirect to the online guide
Diffstat (limited to 'src/ejabberd_web_admin.erl')
-rw-r--r-- | src/ejabberd_web_admin.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ejabberd_web_admin.erl b/src/ejabberd_web_admin.erl index 7f2bd81e4..4ff80eced 100644 --- a/src/ejabberd_web_admin.erl +++ b/src/ejabberd_web_admin.erl @@ -167,15 +167,15 @@ process([<<"doc">>, LocalFile], _Request) -> ?DEBUG("Delivering content.", []), {200, [{<<"Server">>, <<"ejabberd">>}], FileContents}; {error, Error} -> - ?DEBUG("Delivering error: ~p", [Error]), Help = <<" ", FileName/binary, " - Try to specify the path to ejabberd " "documentation with the environment variable " "EJABBERD_DOC_PATH. Check the ejabberd " "Guide for more information.">>, + ?INFO_MSG("Problem '~p' accessing the local Guide file ~s", [Error, Help]), case Error of eacces -> {403, [], <<"Forbidden", Help/binary>>}; - enoent -> {404, [], <<"Not found", Help/binary>>}; + enoent -> {307, [{<<"Location">>, <<"http://docs.ejabberd.im/admin/guide/configuration/">>}], <<"Not found", Help/binary>>}; _Else -> {404, [], <<(iolist_to_binary(atom_to_list(Error)))/binary, Help/binary>>} end |