Results 1 to 5 of 5
-
5th Sep 2011, 01:27 AM #1OPMember
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
-
5th Sep 2011, 01:37 AM #2Member
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.
-
5th Sep 2011, 02:44 AM #3OPMember
Yeah dont have cpanel.
-
13th Sep 2011, 12:39 AM #4OPMember
bump! idk how to enable it in apache! someone help please
-
15th Sep 2011, 03:19 PM #5MemberWebsite's:
learninginn.comthis 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.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Make Money Online - Using Social Media to Make Fast Cash Commissions
By GarryField in forum Webmasters, Money MakingReplies: 0Last Post: 4th Mar 2014, 12:08 PM -
[Hiring] Custom Programmer for Custom Script
By le3on9 in forum ServicesReplies: 2Last Post: 23rd Jul 2012, 04:36 AM -
Can anyone make custom backgrounds here?
By sarah1709 in forum Graphics AreaReplies: 5Last Post: 27th Apr 2011, 01:58 AM -
Unique, Custom, One-Off iPhone WCDDL Script + Mods, over 18 extra custom pages + more
By Skunked in forum Completed TransactionsReplies: 0Last Post: 16th Apr 2010, 08:03 PM
themaCreator - create posts from...
Version 3.47 released. Open older version (or...