How to use your own custom error pages on 000webhost - Printable Version +- howtothings.co.uk (https://www.howtothings.co.uk) +-- Forum: Computing (https://www.howtothings.co.uk/forumdisplay.php?fid=4) +--- Forum: Website Development, Implementation and General Webmaster Support (https://www.howtothings.co.uk/forumdisplay.php?fid=9) +--- Thread: How to use your own custom error pages on 000webhost (/showthread.php?tid=358) |
How to use your own custom error pages on 000webhost - Mark - 09-09-2010 As some of you know i use 000webhost's free hosting services, (not to host this forum, before you get worried) for one or two of my smaller, personal sites and i think their service is top notch. The only problem i came across was how they handled errors, 404s and such. By default they throw you off to their subdomain err.000webhost.com which is filled with ads and to be honest looks a mess and certainly not where you want people visiting your site to be going. Here's a simple fix. 1. Make a file called "error.php", copy and paste the code below in to it, then save. PHP Code: <?php 2. Create a new file and call it ".htaccess". If you create it and it doesn't show up then make one called "htaccess" without the full stop at the beginning and we'll go from there. In this file simply put the following 3 lines, then save: Code: ErrorDocument 403 /error.php Once you've got the two completed files you now need to upload them in to the "public_html" directory of your website. If before you missed out the full stop, rename it through the FTP manager so that it works. Now, go to your domain eg. markwood.co.cc/doesntexist and you'll see your 404 page. |