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 do I set the Default404 route to an external page?

HalfCatHalfCat ✭✭
edited October 2012 in Vanilla 2.0 - 2.8

Well, I would like to redirect my 404 Errors to an external page (but on same domain). Vanilla is installed in the folder /forum and I want the 404 page to be at /404 for example.

I tried to put in an absolute path including http:// but that didn't work.

Best Answer

  • Options
    ToddTodd Chief Product Officer Vanilla Staff
    Answer ✓

    This may be something we didn't intend on happening. I do recommend you make your error pages actual pages in vanilla so that they'll return the proper http codes rather than redirecting somewhere else.

    And if you want to theme your error pages you can always copy their views into your theme. Most of them are in applications/dashboard/views/home.

Answers

  • Options

    Anyone?

  • Options
    KasperKasper Scholar of the Bits Copenhagen Vanilla Staff
    edited October 2012

    Have you tried this config variable:

    $Configuration['Routes']['Default404'] = array('dashboard/home/filenotfound', 'NotFound');
    

    Edit: I just tried changing the url to an external page after which my server threw an "allocated memory exceeded" error in my face.

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

  • Options
    HalfCatHalfCat ✭✭
    edited October 2012

    @kasperisager: Thanks for your reply. That is basically the same as doing it via dashboard settings. What I can't figure out is how to "break out" of the forum folder to link to my 404 page.

    Edit: Didn't see your edit ;)

  • Options
    ToddTodd Chief Product Officer Vanilla Staff
    Answer ✓

    This may be something we didn't intend on happening. I do recommend you make your error pages actual pages in vanilla so that they'll return the proper http codes rather than redirecting somewhere else.

    And if you want to theme your error pages you can always copy their views into your theme. Most of them are in applications/dashboard/views/home.

  • Options

    @Todd: All right, I'll go with that then.

Sign In or Register to comment.