0
Welcome Guest! Login
0 items Join Now

ROCKETTHEME IS CLOSING ON JUNE 30, 2025. As a thank-you to our community, enjoy 50% off all themes with the promo code THANKYOU before we shut down. Read our Farewell Blog Post for more details.

Rockettheme error pages

    • Justin's Avatar
    • Justin
    • Elite Rocketeer
    • Posts: 500
    • Thanks: 3

    Rockettheme error pages

    Posted 16 years 4 months ago
    • I love the new Rockettheme error pages so much so that I type the url incorrectly :cheesy:

      Could we possibly share the php that's used to create these pages or can anyone offer any simular code?

      Many thanks
    • Ragdata's Avatar
    • Ragdata
    • Elite Rocketeer
    • Posts: 614
    • Thanks: 0
    • Software Engineer

    Re: Rockettheme error pages

    Posted 16 years 4 months ago
    • Step 1 - Create funky HTML page

      Step 2 - Drop this in the top of your error.php file immediately before the first '?>'
       
      if($this->error->code = '404'){
          header("HTTP/1.0 404 Not Found");
          include('my_404.html');
          exit();
      }
       
    • Ragdata's Rubber Duck
      www.ragdata.net/
    • Justin's Avatar
    • Justin
    • Elite Rocketeer
    • Posts: 500
    • Thanks: 3

    Re: Rockettheme error pages

    Posted 16 years 4 months ago
    • I've already got the funky pages it's just the php I'm unsure about, thanks for your reply but could you give more info as to creating this?

      i.e. Rocket Theme error pages consist of a nice image with space for the error message to appear, how do I get the error message to show in the correct position? I guess the main errors are:
      301, 400, 403, 404, 500, 505.

      Thanks.
    • Ragdata's Avatar
    • Ragdata
    • Elite Rocketeer
    • Posts: 614
    • Thanks: 0
    • Software Engineer

    Re: Rockettheme error pages

    Posted 16 years 4 months ago
    • Take the include and exit statements out of the code above - as in scrap them ... keep the header call there or you're going to end up with your error pages indexed in Google. Without the header, your error page is just another page and actually returns a 200 status code. The Joomla error.php page without this modification returns a 200 status code. This is just one reason why I'm personally not very happy with the team there for FORCING us onto the bleeding edge of their development in their mad rush to leave their dark Mambo past behind them - quite simply, Joomla 1.5 isn't ready yet ... anyways ...

      Replace the HTML in your error.php with previously-referenced funky custom HTML.

      Place a line something like this wherever it seems most appropriate to you and style to suit:

      <?php echo $this->error->code; ?>

      You could also build up an array of error codes for your new custom error page to reference - something like:

      $error_array = array(404=>"File Not Found",403=>"Forbidden", ... );

      and then change the echo line above to something like:

      <?php echo $this->error->code." - ".$error_array[$this->error->code]; ?>
    • Ragdata's Rubber Duck
      www.ragdata.net/
    • Justin's Avatar
    • Justin
    • Elite Rocketeer
    • Posts: 500
    • Thanks: 3

    Re: Rockettheme error pages

    Posted 16 years 4 months ago
    • Excellent, this is now starting to make sence :D
      I'll give it a go... thanks for you help, no doubt there will be more questions after testing!

Time to create page: 0.070 seconds