Activity Stream
48,167 MEMBERS
6847 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 5 of 5
  1.     
    #1
    Member

    Default how to make custom 404?

    how do i make a custom 404 and make it redirect to index.php

    i have apache and php and i tried using .htacsess but wont work. HELP!
    ViPeRR Reviewed by ViPeRR on . how to make custom 404? how do i make a custom 404 and make it redirect to index.php i have apache and php and i tried using .htacsess but wont work. HELP! Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    If you have cPanel installed I think you can go to Error Logs or Error Pages and there is an option to create a new page there and it'll edit the .htdocs for you.

  4.     
    #3
    Member
    Yeah dont have cpanel.

  5.     
    #4
    Member
    bump! idk how to enable it in apache! someone help please

  6.     
    #5
    Member
    Website's:
    learninginn.com
    this is what i have search for you..

    Part 1) Ok to get custom error pages create a file called error.php copy 'n' paste this into that file:

    PHP Code: 
    <?php
    header
    ("refresh: 5; YOURINDEX.PHP";
    $status $_SERVER['REDIRECT_STATUS'];
    $codes = array(
            
    403 => array('403 Forbidden''The server has refused to fulfill your request.'),
            
    404 => array('404 Not Found''The document/file requested was not found.'),
            
    405 => array('405 Method Not Allowed''The method specified in the Request-Line is not allowed for the specified resource.'),
            
    408 => array('408 Request Timeout''Your browser failed to sent a request in the time allowed by the server.'),
            
    500 => array('500 Internal Server Error''The request was unsuccessful due to an unexpected condition encountered by the server.'),
            
    502 => array('502 Bad Gateway''The server received an invalid response from the upstream server while trying to fulfill the request.'),
            
    504 => array('504 Gateway Timeout''The upstream server failed to send a request in the time allowed by the server.')
            );

    $title $codes[$status][0];
    $message $codes[$status][1];
    if (
    $title == false || strlen($status) != 3) {
        
    $message 'Please supply a valid status code.';
    }

    echo 
    '<p><h1>' $title '</h1></p>' 
         
    '<p>' $message '</p>'

     
    ?>







    Edit your .htaccess file and add this line at the top of the file or before the first rewrite rule:

    RewriteBase /

    Note: if your script is installed on some directory, for example /forum, you have to place RewriteBase /forum line to the .htaccess file (.htaccess file must be also located in /forum directory)

    Save that file

    Part 2) Also, there is a file called .htaccess there is only one way to get at this, go to the domain cpanel , then theres and area called "? Files" there should be an image with a link below it called "File Manager", don't mistake this for "Another File Manager" other wise this wont work click "File Manager" then login, there should be a folder called "public_html" go into that folder there should be a file called ".htaccess" it will be a HTACCESS File edit that file if theres something like Options All replace it with:
    ErrorDocument 403 /error.php
    ErrorDocument 404 /error.php
    ErrorDocument 500 /error.php

    Save it then test it by going to your website then after the / at the end of the domain type something like "hjdhfsjkbhdgsbjkvhbjsfh" unless that's already a file but you get the general idea.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Make Money Online - Using Social Media to Make Fast Cash Commissions
    By GarryField in forum Webmasters, Money Making
    Replies: 0
    Last Post: 4th Mar 2014, 12:08 PM
  2. [Hiring] Custom Programmer for Custom Script
    By le3on9 in forum Services
    Replies: 2
    Last Post: 23rd Jul 2012, 04:36 AM
  3. Can anyone make custom backgrounds here?
    By sarah1709 in forum Graphics Area
    Replies: 5
    Last Post: 27th Apr 2011, 01:58 AM
  4. Replies: 0
    Last Post: 16th Apr 2010, 08:03 PM

Tags for this Thread

BE SOCIAL