Free Web Hosting Forum
Go Back   Free Web Hosting Forum > 000WebHost Services > Spanish Forum
Reload this Page ¿Se permite página de error 404 personalizada?
Reply

 

Thread Tools Display Modes
(#1 (permalink))
Old
Junior Member
OSDAKI is on a distinguished road
 
Posts: 16
Join Date: Sep 2008
Location: Guatemala
Send a message via MSN to OSDAKI Send a message via Skype™ to OSDAKI
Default ¿Se permite página de error 404 personalizada? - 10-01-2008, 04:31 PM

¿Se puede usar una página personalizada de error 404? Si es así, ¿Cómo lo hago?

Gracias.
Reply With Quote
(#2 (permalink))
Old
bryan's Avatar
Moderator
bryan is an unknown quantity at this point
 
Posts: 1,102
Join Date: Jul 2008
Location: citizen of world
Default 10-01-2008, 11:53 PM

si se puede por aqui en el foro hay un tutorial de como hacerlo (en ingles) realmente fácil o puedes buscar uso de .htaccess en la red para uso de paginas de error igual realmente fácil, saludos.


Dominios tunombre.info a sólo us$ 2.00 Disponibles 3 enviame MP si estas interesado.
-----------------------------------------------------
Prueba 7 dias gratis <<< CPANEL Si necesitas probar entra aca.
-----------------------------------------------------
wWw.dominio.cc <<< Dominios Gratuitos muy recomendables control total NS, A, CNAME, MX, etc.
-----------------------------------------------------
También puedes darme 1 punto en karma si mi respuesta te ayudo.
Reply With Quote
(#3 (permalink))
Old
bryan's Avatar
Moderator
bryan is an unknown quantity at this point
 
Posts: 1,102
Join Date: Jul 2008
Location: citizen of world
Default 10-03-2008, 07:27 PM

Quote:
Originally Posted by aha123 View Post
Part 1) Ok to get custom error pages create a file called error.php copy 'n' paste this into that file:

PHP Code:
<?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>'

 
?>
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 (000webhost's very own), 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 and if it comes up with 000webhost's default error page then some things gone wrong and i don't know what but otherwise it should work
me encontre con el tuto de paginas de error personalizadas y lo pongo aca para que lo usen. saludos.


Dominios tunombre.info a sólo us$ 2.00 Disponibles 3 enviame MP si estas interesado.
-----------------------------------------------------
Prueba 7 dias gratis <<< CPANEL Si necesitas probar entra aca.
-----------------------------------------------------
wWw.dominio.cc <<< Dominios Gratuitos muy recomendables control total NS, A, CNAME, MX, etc.
-----------------------------------------------------
También puedes darme 1 punto en karma si mi respuesta te ayudo.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.6.9
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0
vBulletin Skin developed by: vBStyles.com