Accueil > > > AFFICHER ADRESSE PAGE D'ACCUEIL
AFFICHER ADRESSE PAGE D'ACCUEIL
Information sur la source
Description
Ceci est petit script pas génial mais qui est très serviable dans les erreurs 404 En fait c'est une page 404 avec un lien vers la page d'accueil en fait il affiche l'adresse de la page d'accueil du site en lien.
Source
- <php
- include "zip, zip, zip";
- ?>
-
- merci de prendre le zip mais si c'est vraiment non :
-
- Mais vous pouvez suivre le code ici :
- Avec . htaccess
- ----------------
- .htaccess :
-
- ErreurDocument 404 erreur404.html
-
- erreur404.html :
-
- <html>
- <head>
- <script>
-
- function Homepage(){
-
- <!--
-
- // in real bits, urls get returned to our script like this:
-
- // res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm
-
-
-
- //For testing use DocURL = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
-
- DocURL = document.URL;
-
-
-
- //this is where the http or https will be, as found by searching for :// but skipping the res://
-
- protocolIndex=DocURL.indexOf("://",4);
-
-
-
- //this finds the ending slash for the domain server
-
- serverIndex=DocURL.indexOf("/",protocolIndex + 3);
-
-
-
- //for the href, we need a valid URL to the domain. We search for the # symbol to find the begining
-
- //of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
-
- //urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
-
- BeginURL=DocURL.indexOf("#",1) + 1;
-
-
-
- urlresult=DocURL.substring(BeginURL,serverIndex);
-
-
-
- //for display, we need to skip after http://, and go to the next slash
-
- displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);
-
-
-
- InsertElementAnchor(urlresult, displayresult);
-
- }
-
-
- function HtmlEncode(text)
- {
- return text.replace(/&/g, '&').replace(/'/g, '"').replace(/</g, '<').replace(/>/g, '>');
- }
-
- function TagAttrib(name, value)
- {
- return ' '+name+'="'+HtmlEncode(value)+'"';
- }
-
- function PrintTag(tagName, needCloseTag, attrib, inner){
- document.write( '<' + tagName + attrib + '>' + HtmlEncode(inner) );
- if (needCloseTag) document.write( '</' + tagName +'>' );
- }
-
- function URI(href)
- {
- IEVer = window.navigator.appVersion;
- IEVer = IEVer.substr( IEVer.indexOf('MSIE') + 5, 3 );
-
- return (IEVer.charAt(1)=='.' && IEVer >= '5.5') ?
- encodeURI(href) :
- escape(href).replace(/%3A/g, ':').replace(/%3B/g, ';');
- }
-
- function InsertElementAnchor(href, text)
- {
- PrintTag('A', true, TagAttrib('HREF', URI(href)), text);
- }
-
- //-->
-
- </script>
-
- </head>
- <body>
- <p align="center"><font color="#FF0000"><h1><u>404 not found</u></h1></font></p><br>// écrire 404 not found
- <p align="left"><font color="#FF0000"><h2>La page est introuvable</h2></font></p><br><br>
- <span style="color: #ff0000">La page d'accueil de ce site est <script>
-
- <!--
-
- if (!((window.navigator.userAgent.indexOf("MSIE") > 0) && (window.navigator.appVersion.charAt(0) == "2")))page
-
- {
-
- Homepage();
-
- }
-
- //-->
-
- </script>
- <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
- <p align="left"><font color="#FF0000"><h7>Affichage de la page d'accueil sans .htaccess Code écrit par Cédric Denotte</h7></font><br>
- <font color="#FF0000"><h7>Copyright 26/12/2006</h7></font><br>
- <font color="#FF0000"><h7><a href="http://www.cdd-pro.com">http://www.cdd-pro.com</a> | <a href="mailto:cdd@cdd-pro.com">cdd@cdd-pro.com</a></h7></font><br>
- <font color="#FF0000"><h7>E-mail et site web valide à partir du 28/12/2006 Sinon <a href="mailto:cedric_denotte@msn.com">cedric_denotte@msn.com</a></h7></font></p>
- </body>
- </html>
-
- -------------------------------------------------------------------------------------------------------------------------
- Sans .htaccess
- ---------------
-
- index.html :
-
- <html>
-
- <head>
- <script>
-
- function Homepage(){
-
- <!--
-
- // in real bits, urls get returned to our script like this:
-
- // res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm
-
-
-
- //For testing use DocURL = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
-
- DocURL = document.URL;
-
-
-
- //this is where the http or https will be, as found by searching for :// but skipping the res://
-
- protocolIndex=DocURL.indexOf("://",4);
-
-
-
- //this finds the ending slash for the domain server
-
- serverIndex=DocURL.indexOf("/",protocolIndex + 3);
-
-
-
- //for the href, we need a valid URL to the domain. We search for the # symbol to find the begining
-
- //of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
-
- //urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
-
- BeginURL=DocURL.indexOf("#",1) + 1;
-
-
-
- urlresult=DocURL.substring(BeginURL,serverIndex);
-
-
-
- //for display, we need to skip after http://, and go to the next slash
-
- displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);
-
-
-
- InsertElementAnchor(urlresult, displayresult);
-
- }
-
-
- function HtmlEncode(text)
- {
- return text.replace(/&/g, '&').replace(/'/g, '"').replace(/</g, '<').replace(/>/g, '>');
- }
-
- function TagAttrib(name, value)
- {
- return ' '+name+'="'+HtmlEncode(value)+'"';
- }
-
- function PrintTag(tagName, needCloseTag, attrib, inner){
- document.write( '<' + tagName + attrib + '>' + HtmlEncode(inner) );
- if (needCloseTag) document.write( '</' + tagName +'>' );
- }
-
- function URI(href)
- {
- IEVer = window.navigator.appVersion;
- IEVer = IEVer.substr( IEVer.indexOf('MSIE') + 5, 3 );
-
- return (IEVer.charAt(1)=='.' && IEVer >= '5.5') ?
- encodeURI(href) :
- escape(href).replace(/%3A/g, ':').replace(/%3B/g, ';');
- }
-
- function InsertElementAnchor(href, text)
- {
- PrintTag('A', true, TagAttrib('HREF', URI(href)), text);
- }
-
- //-->
-
- </script>
-
- </head>
- <body>
- <span style="color: #ff0000">La page d'accueil de ce site est <script>
-
- <!--
-
- if (!((window.navigator.userAgent.indexOf("MSIE") > 0) && (window.navigator.appVersion.charAt(0) == "2")))
-
- {
-
- Homepage();
-
- }
-
- //-->
-
- </script>
- <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
- <p align="left"><font color="#FF0000"><h7>Affichage de la page d'accueil sans .htaccess Code écrit par Cédric Denotte</h7></font><br>
- <font color="#FF0000"><h7>Copyright 26/12/2006</h7></font><br>
- <font color="#FF0000"><h7><a href="http://www.cdd-pro.com">http://www.cdd-pro.com</a> | <a href="mailto:cdd@cdd-pro.com">cdd@cdd-pro.com</a></h7></font><br>
- <font color="#FF0000"><h7>E-mail et site web valide à partir du 28/12/2006 Sinon <a href="mailto:cedric_denotte@msn.com">cedric_denotte@msn.com</a></h7></font></p>
-
- </body>
- </html>
- -------------------------------------------------------------------------------------------------------------------------
- Merci plutot de télécharger le zip
<php
include "zip, zip, zip";
?>
merci de prendre le zip mais si c'est vraiment non :
Mais vous pouvez suivre le code ici :
Avec . htaccess
----------------
.htaccess :
ErreurDocument 404 erreur404.html
erreur404.html :
<html>
<head>
<script>
function Homepage(){
<!--
// in real bits, urls get returned to our script like this:
// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm
//For testing use DocURL = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
DocURL = document.URL;
//this is where the http or https will be, as found by searching for :// but skipping the res://
protocolIndex=DocURL.indexOf("://",4);
//this finds the ending slash for the domain server
serverIndex=DocURL.indexOf("/",protocolIndex + 3);
//for the href, we need a valid URL to the domain. We search for the # symbol to find the begining
//of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
//urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
BeginURL=DocURL.indexOf("#",1) + 1;
urlresult=DocURL.substring(BeginURL,serverIndex);
//for display, we need to skip after http://, and go to the next slash
displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);
InsertElementAnchor(urlresult, displayresult);
}
function HtmlEncode(text)
{
return text.replace(/&/g, '&').replace(/'/g, '"').replace(/</g, '<').replace(/>/g, '>');
}
function TagAttrib(name, value)
{
return ' '+name+'="'+HtmlEncode(value)+'"';
}
function PrintTag(tagName, needCloseTag, attrib, inner){
document.write( '<' + tagName + attrib + '>' + HtmlEncode(inner) );
if (needCloseTag) document.write( '</' + tagName +'>' );
}
function URI(href)
{
IEVer = window.navigator.appVersion;
IEVer = IEVer.substr( IEVer.indexOf('MSIE') + 5, 3 );
return (IEVer.charAt(1)=='.' && IEVer >= '5.5') ?
encodeURI(href) :
escape(href).replace(/%3A/g, ':').replace(/%3B/g, ';');
}
function InsertElementAnchor(href, text)
{
PrintTag('A', true, TagAttrib('HREF', URI(href)), text);
}
//-->
</script>
</head>
<body>
<p align="center"><font color="#FF0000"><h1><u>404 not found</u></h1></font></p><br>// écrire 404 not found
<p align="left"><font color="#FF0000"><h2>La page est introuvable</h2></font></p><br><br>
<span style="color: #ff0000">La page d'accueil de ce site est <script>
<!--
if (!((window.navigator.userAgent.indexOf("MSIE") > 0) && (window.navigator.appVersion.charAt(0) == "2")))page
{
Homepage();
}
//-->
</script>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<p align="left"><font color="#FF0000"><h7>Affichage de la page d'accueil sans .htaccess Code écrit par Cédric Denotte</h7></font><br>
<font color="#FF0000"><h7>Copyright 26/12/2006</h7></font><br>
<font color="#FF0000"><h7><a href="http://www.cdd-pro.com">http://www.cdd-pro.com</a> | <a href="mailto:cdd@cdd-pro.com">cdd@cdd-pro.com</a></h7></font><br>
<font color="#FF0000"><h7>E-mail et site web valide à partir du 28/12/2006 Sinon <a href="mailto:cedric_denotte@msn.com">cedric_denotte@msn.com</a></h7></font></p>
</body>
</html>
-------------------------------------------------------------------------------------------------------------------------
Sans .htaccess
---------------
index.html :
<html>
<head>
<script>
function Homepage(){
<!--
// in real bits, urls get returned to our script like this:
// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm
//For testing use DocURL = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
DocURL = document.URL;
//this is where the http or https will be, as found by searching for :// but skipping the res://
protocolIndex=DocURL.indexOf("://",4);
//this finds the ending slash for the domain server
serverIndex=DocURL.indexOf("/",protocolIndex + 3);
//for the href, we need a valid URL to the domain. We search for the # symbol to find the begining
//of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
//urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
BeginURL=DocURL.indexOf("#",1) + 1;
urlresult=DocURL.substring(BeginURL,serverIndex);
//for display, we need to skip after http://, and go to the next slash
displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);
InsertElementAnchor(urlresult, displayresult);
}
function HtmlEncode(text)
{
return text.replace(/&/g, '&').replace(/'/g, '"').replace(/</g, '<').replace(/>/g, '>');
}
function TagAttrib(name, value)
{
return ' '+name+'="'+HtmlEncode(value)+'"';
}
function PrintTag(tagName, needCloseTag, attrib, inner){
document.write( '<' + tagName + attrib + '>' + HtmlEncode(inner) );
if (needCloseTag) document.write( '</' + tagName +'>' );
}
function URI(href)
{
IEVer = window.navigator.appVersion;
IEVer = IEVer.substr( IEVer.indexOf('MSIE') + 5, 3 );
return (IEVer.charAt(1)=='.' && IEVer >= '5.5') ?
encodeURI(href) :
escape(href).replace(/%3A/g, ':').replace(/%3B/g, ';');
}
function InsertElementAnchor(href, text)
{
PrintTag('A', true, TagAttrib('HREF', URI(href)), text);
}
//-->
</script>
</head>
<body>
<span style="color: #ff0000">La page d'accueil de ce site est <script>
<!--
if (!((window.navigator.userAgent.indexOf("MSIE") > 0) && (window.navigator.appVersion.charAt(0) == "2")))
{
Homepage();
}
//-->
</script>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<p align="left"><font color="#FF0000"><h7>Affichage de la page d'accueil sans .htaccess Code écrit par Cédric Denotte</h7></font><br>
<font color="#FF0000"><h7>Copyright 26/12/2006</h7></font><br>
<font color="#FF0000"><h7><a href="http://www.cdd-pro.com">http://www.cdd-pro.com</a> | <a href="mailto:cdd@cdd-pro.com">cdd@cdd-pro.com</a></h7></font><br>
<font color="#FF0000"><h7>E-mail et site web valide à partir du 28/12/2006 Sinon <a href="mailto:cedric_denotte@msn.com">cedric_denotte@msn.com</a></h7></font></p>
</body>
</html>
-------------------------------------------------------------------------------------------------------------------------
Merci plutot de télécharger le zip
Conclusion
Si je trouves des amériotations encore mieux je vous les envois tout de suite !!! biento une adresse d'exemple.
~mon site~ http://www.cdd-pro.com
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
SOCKET pour suivre en temps réel la variation d'entrées logiques. [ par jlop ]
Bonjour, je vraiment très débutant en javascript. J'aurais le besoin suivant: Un serveur WEB tourne sur une carte éléctronique gère par exemple des en
Pb frame et affichage d'adresse [ par Amadeus ]
La page index de mon site contient une FRAME :Dans index.htm, j'ai mis cela :<FRAMESET COLS="24%,76%" BORDER="0"><FRAME src="Liste.htm">&l
detecter le changement d'adresse dans un frame [ par n3co ]
Bonjour,est-ce que c'est possible de détecter, sur une page HTML contenant 2 frames, le changement de page sur l'un et le récupérer dans l'autre ?C'es
Barre de progréssion durant le chargement d'un page [ par rem78 ]
Bonjour,Je suis actuellement entraint de réaliser mon site et ma page d'accueil comporte des frames (cadres) et je souhaite la faire ouvrir en mode pl
Dialogue entre frames: petit soucis [ par Tiscripteur ]
J'ai un soucis que je n'arrive pas à résoudre:Je n'arrive pas à récupérer l'adresse de la frame qui m'héberge.Si elle se trouve sur le même serveur qu
impression page web sans adresse [ par shaft107 ]
slt a tousj'ai un pb,je voudrai imprimer une page web mais sans l'adresse de la page car ils'agit de l'imprimer sur un papier entetejavascript ou vb s
Besoin d'aide pour créer un cookie [ par gproulx ]
Bonjour à tous!J'ai un petit problème. Je dois créer un cookie, seulement j'ai jamais fait cela et n'étant que graphiste pour site web, la programmati
envoi de mail avec lotus [ par katwes ]
Bonjour,J'essaie d'envoyer une page par mail en cliquant sur un icône. Ca fonctionne avec outlook mais quand la messagerie est lotus, l'adresse d
Changer de page sans changer l'adresse [ par astuces_jeux ]
Bonjour, Je cherche comment faire pour créer une page ou comme javascriptfr.comil y a des liens : derniers codes/tutoriaux/vidéo/codes modif
Apparition d'images [ par laubro ]
Bonjour,je voudrais, pour une page d'accueil, composée en fait de 4 images, formant un carré une fois réunis, avoir un effet faisant en
|
Derniers Blogs
IMAGINE CUP 2012, MAKE A SIGN EN FINALEIMAGINE CUP 2012, MAKE A SIGN EN FINALE par junarnoalg
Voilà qui est fait, la nouvelle est officielle ! L'équipe belge "Make a Sign" va au pays des kangourous défendre son projet dans la catégorie Software Design. http://www.imaginecup.com/CompetitionsContent/Competition/WorldwideFinalists.aspx V...
Cliquez pour lire la suite de l'article par junarnoalg KINECT 1.5 IS OUT !KINECT 1.5 IS OUT ! par Vko
La version 1.5 du Kinect For Microsoft vient tout juste de sortir ! Plein de nouveautés: Tracking de squelette en Near Mode Détection en position assise Détection faciale avec un SDK dédié Documentation et des guideline (enfin) Un out...
Cliquez pour lire la suite de l'article par Vko LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) par richardc
Mise à jour des Web API du 14 Mai
Réservez dès maintenant votre journée du 20 juin pour le Windows Azure Dev Camp 2012 à Paris
Mise à jour de Team Foundation Service
MechCommander 2 sur Windows 8
Entity Framework 5 Release Candidate e...
Cliquez pour lire la suite de l'article par richardc REACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITERREACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITER par Groc
Une mauvaise utilisation de rx lors de l'écriture d'une couche d'accès à des services peut conduire à des cas embarassants avec des erreurs mal gérées, des appels qui ne partent lorsqu'ils le devraient, et même des résultats incorrects . le tout nuis...
Cliquez pour lire la suite de l'article par Groc SHAREPOINT BLOG SITE, PROBLèME D'ARCHIVESSHAREPOINT BLOG SITE, PROBLèME D'ARCHIVES par junarnoalg
Dernièrement, nous avons migré le site
myTIC
vers un nouveau serveur SharePoint 2010. Dans les contenus que nous vouloins récupérer, nous avions un certain nombre de blogs.
Nous avons utilisé les commandes Power...
Cliquez pour lire la suite de l'article par junarnoalg
Logiciels
sDEVIS-FACTURES vlPRO (8.1.0.3)SDEVIS-FACTURES VLPRO (8.1.0.3)sDEVIS-FACTURES vlPRO a été mis au point pour les particuliers, créateurs, entrepreneurs, artisa... Cliquez pour télécharger sDEVIS-FACTURES vlPRO 974 Application Server (12.2.4.6)974 APPLICATION SERVER (12.2.4.6)Développez de puissantes applications dans un environnement de 'cloud computing', clusterisé, séc... Cliquez pour télécharger 974 Application Server vPicture (1.4.2.1)VPICTURE (1.4.2.1)Avec vPicture, hébergez vos images facilement et rapidement.
vPicture est un utilitaire simple, ... Cliquez pour télécharger vPicture Easy-Planning (2.2.1.6)EASY-PLANNING (2.2.1.6)Easy-Planning permet de créer des plannings sous la représentation de diagrammes et est adapté au... Cliquez pour télécharger Easy-Planning COM-BACKUP (2.0)COM-BACKUP (2.0)
COM-BACKUP est un logiciel de sauvegarde qui permet de planifier les sauvegardes de vos dossiers ...
Cliquez pour télécharger COM-BACKUP
|