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

404 Site - Where and under which file name?

phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

Hi everbody,

Sorry, it might come a little stupid, but i actually don't know where i should place my 404.php or filenotfound.php to make it appear.

I found it in the routes called /dahsboard/home/.

But this folder doesn't exist under dashboard... Mmh. Any ideas.

  • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
  • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
Tagged:
«1

Comments

  • peregrineperegrine MVP
    edited March 2013

    you could leave the route as it it was configured for default404 which was
    as so in conf/config.php

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

    by default it resides in applications/dashboard/views/home

    edited:

    see Businessdad's comment below as to where to place your copy of filenotfound.php :).

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • businessdadbusinessdad Stealth contributor MVP
    edited March 2013

    To avoid your page being overwritten, you can just place filenotfound.php in your theme folder. Put it into you_theme_folder/views/home, Vanilla will pick it up automatically. :)

    peregrineUnderDoghgtonightShadowdare
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    You could also use the Bonk/404 plugin and route it as well

    $Configuration['Routes']['Default404'] = 'plugin/Bonk' :)

  • Interesting question which I should have googled for : If you make a custom route in the dashboard, let's say 'UnderDog', does that show up in the config.php somehow?

  • hgtonighthgtonight ∞ · New Moderator
    edited March 2013

    @UnderDog all my internal routes show up in my config.php with seemingly random key names. E.g.

    $Configuration['Routes']['c2VydmVycw=='] = 'a:2:{i:0;s:19:"plugin/page/servers";i:1;s:8:"Internal";}';
    $Configuration['Routes']['Y2hhdA=='] = 'a:2:{i:0;s:16:"plugin/page/chat";i:1;s:8:"Internal";}';
    $Configuration['Routes']['YWJvdXQ='] = 'a:2:{i:0;s:17:"plugin/page/about";i:1;s:8:"Internal";}';
    

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

    @businessdad: this doesn't seem to work, i still get BONKs. ;(

    Thank you all for your responses.

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • businessdadbusinessdad Stealth contributor MVP

    @phreak said:
    businessdad: this doesn't seem to work, i still get BONKs. ;(

    Bonk and 404 are two different things. Do you know the reason for the bonk?

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    @phreak You should put it in the forum folder that way it becomes an internal url and you can use :

    $Configuration['Routes']['Default404'] = '/filenotfound.php '

    I have added several pages like this and routed them and works fine.

    businessdad
  • businessdadbusinessdad Stealth contributor MVP

    @vrijvlinder said:
    phreak You should put it in the forum folder that way it becomes an internal url and you can use :
    $Configuration['Routes']['Default404'] = '/filenotfound.php '

    That's true, but I'm sure that even just copying the file works, I do it all the time. Let's see what's the reason for the bonk. :)

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited March 2013

    I think it has to do with how the url is written in that part. I tried routing it to an external 404 I had made for my main site and kept getting bonked. Finally I just added that file to the forum folder and it worked. This or a plugin page seem to be the best solution for me.

    $Configuration['Routes']['Default404'] = '/404.html '

  • phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

    OK, i also tried this route to a direct file in the root folder of my forum. I also tried that... and this time i get a Fatal Error.
    Weird weird...

    Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes) in /www/htdocs/w00fd8ae/library/core/class.dispatcher.php on line 486

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • businessdadbusinessdad Stealth contributor MVP
    edited March 2013

    @phreak said:
    OK, i also tried this route to a direct file in the root folder of my forum. I also tried that... and this time i get a Fatal Error.
    Weird weird...

    That just means you are running out of memory. You should go into the php.ini and increase the maximum memory available to PHP. The parameter is called memory_limit. I usually set it to 256M, which should be enough for most websites.

    Edit: here's a bit of a tutorial about it: 3 Ways to Increase PHP Memory Limit.

    Clarification: earlier I wrote "That's a PHP issue", but I meant "it's an issue related to PHP". There's nothing wrong with PHP itself. :)

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Try doing that using an html file. anything , it could be your php file has an error, using an html file to test this method first, if it works then the issue is your file.

  • peregrineperegrine MVP
    edited March 2013

    I think your error has nothing to do with memory exhaustion - it is a result of the redirect looping and exhaustion - They used to call them rabbits - programs that looped till you ran out of memory.

    Are you getting bonks because of trying to add a 404 page - page not found.

    or are you getting bonks from something else.

    Clarification - needs to be made for people to troubleshoot.

    I suggest you remove any line in config.php that refers to
    
    $Configuration['Routes']['Default404'] = ......
    
    
    then you can do this - cleanest way.
    
    
    copy applications/dashboard/views/home/filenotfound.php
    
    
    
    to  themes/YOURTHEMEGOESHERE/views/home/filenotfound.php
    
    
    edit the file themes/YOURTHEMEGOESHERE/views/home/filenotfound.php
    
    make sure the filenotfound.php is free of errors.
    
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

    businessdadUnderDog
  • businessdadbusinessdad Stealth contributor MVP

    @peregrine said:
    They used to call them rabbits - programs that looped till you ran out of memory.

    I learned a new term today. It goes well with the old "abend" of old mainframe times.

    peregrine
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    you could also copy the contents of said file into this plugin and save yourself the troubles ?

    http://vanillaforums.org/addon/bonk-plugin

  • peregrineperegrine MVP
    edited March 2013

    @vrijvlinder said:
    you could also copy the contents of said file into this plugin and save yourself the troubles ?

    http://vanillaforums.org/addon/bonk-plugin

    until Phreak clarifies the issue - he is working with 404 file not found (not a bonk error). His attempted change to 404 resulted in a bonk. He was bonk free until he tried to change the 404 result.

    so he needs simplify not complicate.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

    UnderDog
  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited March 2013

    where i should place my 404.php or filenotfound.php to make it appear.

    He wants to replace the original filenotfound with his custom one , I understand that.
    He wants his own custom 404 bonk and adding it in the routes is bonking him out,no?

    He is getting bonked with his bonk ....

    this is what my bonk page looks link in config.php, However in the dashboard I only entered plugin/Bonk instead of the default 404. Before that I had an 404.html same idea but without the benefits of the plugin...Maybe if you copy this link and just replace the relevant parts like the url

    $Configuration['Routes']['Default404'] = 'a:2:{i:0;s:11:"plugin/Bonk";i:1;s:8:"NotFound";}';

  • peregrineperegrine MVP
    edited March 2013

    @vrijvlinder

    bonk = error

    404 = file not found

    two different issues.

    @phreak

    read this

    http://vanillaforums.org/discussion/comment/177746/#Comment_177746

    then we can stop guessing whether you are trying to change bonk page or 404 page.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • looks like either he changed the definitions or found the page.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.