Aller au contenu

Chercher dans la communauté

Affichage du résultat pour les tags 'réécriture'.

  • Rechercher par étiquette

    Saisir les étiquettes en les séparant par une virgule.
  • Recherche par auteur

Type du contenu


Forums

  • Accueil
    • Les nouveaux membres se présentent
    • Revues de presse
    • Le salon de Webmaster Hub
    • La tribune de Webmaster Hub
  • Publications et Redirections
    • Référencement et Publicité
    • Droit, Finances et Administration
    • Les techniques de l'Internet
    • Noms de domaines et hébergement
    • La tribune du Hub
  • Création et exploitation de Sites Internet
    • Les langages du Net
    • Les fondations d'un site
    • Accessibilité et Ergonomie Web
    • E-commerce
    • Administration & Droit
    • Systèmes de publication
  • Promotion de Sites Internet
    • Techniques de Référencement
    • Techniques de Promotion
  • Informatique & Internet
    • PC-Gyver
    • Les Navigateurs
  • Les services de Webmaster Hub
    • Infogérance serveurs dédiés
    • Partenariat et échanges de liens
    • Offres et demandes de prestations de service

Rechercher dans...

Chercher ce qui...


Date de création

  • Début

    End


Dernière mise à jour

  • Début

    End


Filtrer par...

Inscrit

  • Début

    End


Groupe


Mon Site


Skype


Localisation


Société

  1. Bonjour, je vous envoie ce message pour vous faire part de ma situation: Je suis le webmaster du site ultimatepocket.com qui fonctionnait il y a encore qqs jours sous postnuke, j'ai réussi à le faire migrer vers Joomla (gros boulot de sql). Maintenant le pb qu'il me reste concerne les anciennes URLs qui sont stockées sur google et tous les sites poitant vers moi. En effet si qqun clique sur google sur un lien de mon site, il trouveras une erreur 404 car l'url est désormais différente (mais pas la numérotatoin des articles) Concretement les anciennes adresses postnuke sont de ce type: http://www.ultimatepocket.com/modules.php?...order=0&thold=0 et les nouvelles de ce type là: http://www.ultimatepocket.com/index.php?op...id=27&Itemid=41 (27 est la seule variable) J'ai essayé par diverses méthodes de modifier le .htaccess, mais rien ne marche: voila par ex mon dernier essai: RewriteEngine On RewriteRule ^modules\.php\?op\=modload\&name\=News\&file\=article\&sid\=([^/]*)\&mode\=thread\&order\=0\&thold\=0$ /index.php?option=com_content&task=view&id=$1&Itemid=41 [L] J'ai également essayé avec Redirect permanent en mettant les adresses en dure...mais ca ne passe pas non plus. Si qqui a déja rencontré ce pb, ou saurait comment faire...je suis tout ouïe! Thanks in advance. merci d'avance Charles www.ultimatepocket.com PS: réponse par email acceptée: charles [ATnospam]ultimatepocket.com
  2. Bonjour, Spider Reporter est un logiciel en PHP qui analyse les visites des robots du web. Qu'est-ce qui est particulier à notre projet ? - Spider Reporter fonctionne avec un tag invisible ou à partir du fichier log. - Il permet aussi de définir un Spider Reporter Map, une liste d'URL que l'on veut analyser plus particulièrement (nouvelles pages dont on veut savoir quand elles seront crawlées pour la première fois, pages redirigées pour voir si la redirection est suivie, comparaison du comportement de deux moteurs vis-à-vis des tirets dans les URL,...). Voir la démo : 10 screenshots de Spider Reporter - aucune augmentation de charge du réseau - aucune de vos stats n'est transmise à des tiers - entièrement écrit en PHP Spider Reporter convient à toutes sortes de sites. Jusqu'à présent, nous l'avons testé avec succès, sur des sites avec plusieurs dizaines milliers de pages visitées par Googlebot par mois. Actuellement les explications sur l'installation sont assez sommaires. Cela ne posera pas de problème à ceux qui ont déjà installé d'autres programmes de stat, mais cela pourrait gêné des webmasters moins expérimentés. Posez vos questions ici ou via le formulaire de notre site. Autres fonctions prévues (non encore installées) : - mise à jour automatique de la liste des robots - support d'autres formats de fichier log - forum dédicacé La version actuelle est une version d'évaluation. Elle est gratuite. On a vraiment besoin de vos avis et critiques. Jean-Luc
  3. kattig

    Redirection sous condition.

    Bonsoir, J'ai un petit soucis concernant la redirection d'une page. Je pensais avoir bien écrit le code, cependant, cela ne fonctionne pas et affiche un message d'erreur. Mon code est le suivant: if (ma condition) { header("Location: ./accueil.php?page=reservation.php"); } Le message d'erreur qui s'affiche est: Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp1-8\www\projet_ci2\accueil.php:11) Je vous remercie d'avance pour votre aide. kattig
  4. J'ai découvert des forums dans lesquels des particuliers vendent des noms de domaines avec de bons PR (6/7/Cool et j'aimerai savoir si en achetant ces noms de domaines, on peut le récupérer sur le site d'origine via une redirection chez le registrar? en fait ce que l'on voudrait c'est que monsite.com ait le PR de siteacheté.com est-ce vraiment possible? Le transfert de PR est-il rapide ou il faut attendre quelques google dance? Eclairez moi sur ce point je suis pas encore très doué sur les redirections... merci beaucoup!
  5. Bonjour, j'ai un blog sur hautetfort.com et 2 gros soucis : QUESTION 1) j'ai inséré un marqueur XITI en ajoutant {literal} puis {/literal} en début et fin de code en pensant qu'ainsi il le prendrait en compte, mais ça ne fonctionne pas. Le marqueur ne s'affiche pas et ne comptabilise pas les visites. ce qui donne : {literal} <script type="text/javascript"> <!-- Xt_param = 's=xxxxx&p='; try {Xt_r = top.document.referrer;} catch(e) {Xt_r = document.referrer; } Xt_h = new Date(); Xt_i = '<img width="39" height="25" border="0" '; Xt_i += 'src="http://logv30.xiti.com/hit.xiti?'+Xt_param; Xt_i += '&hl='+Xt_h.getHours()+'x'+Xt_h.getMinutes()+'x'+Xt_h.getSeconds(); if(parseFloat(navigator.appVersion)>=4) {Xt_s=screen;Xt_i+='&r='+Xt_s.width+'x'+Xt_s.height+'x'+Xt_s.pixelDepth+'x'+Xt_s.colorDepth;} document.write(Xt_i+'&ref='+Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$')+'" title="Analyse d\'audience">'); //--> </script> <noscript> analyse mesure frequentation internet par <img width="39" height="25" src="http://logv30.xiti.com/hit.xiti?s=xxxxx&p=" alt="Analyse d'audience" /> </noscript></a> {/literal} QUESTION 2) j'avais un ancien blog hautetfort.com. Il comptabilise plus de visites que mon nouveau blog alors qu'il est vide.... On va appeler l'ancien blog "blog "1 et le nouveau blog "blog 2" J'ai mis en page d'accueil du blog 1 le lien du blog 2. Si j'insère une redirection du blog 1 vers le blog 2, les visiteurs se connectant sur le blog 1 seront ils comptabilisés comme visiteurs sur le blog 2 ? Quel type de code de redirection dois-je insérer ? Merci par avance de votre aide !!! zenation EDIT TheRec/Modérateur : Premièrement, utilises les balises BBCode appropriées pour présenter ton code, il y a un lien "Aide BB Code" en dessous des émoticons lorsque tu rédiges un message. Deuxièmement, nous ne sommes pas aveugles donc n'abuse pas de la mise en forme (couleur, taille, ...) et quand bien même le serions-nous cela ne nous aiderait pas des gros textes de toutes les couleurs. Cela fait partie de règles du forum, merci de les relire et de les respecter.
  6. Salut a tous. Alors voila j'ai un petit problème que je n'arrive pas a regler. Admettons qu'un client envoie un mail a une personne de la boite. Je souhaiterai que ce mail arrive en copie sur une adresse type sauvegarde @ site.com Je souhaiterai que ca se fasse de facon automatique et pas que ce soit le client qui soit obligé de mettre cette adresse en CC. Merci d'avance pour vos réponses ! sylvain
  7. Salut, Je cherche à faire une redirection permanente de ma racine vers le répertoire www pour éviter d'avoir plusieurs formats de page indexées. En gros : http://mondomaine.com vers http://www.mondomaine.com http://mondomaine.com/mapage.html vers http://www.mondomaine.com/mapage.html J'ai essayé en .htaccess mais je me suis retrouvé avec un boucle infinie
  8. Voilà, Sur un site que j'ai créé j'ai placé des dossiers virtuels de manière à pouvoir atteindre facilement les rubriques principales du site. Pour ce faire, j'ai utilisé la directive RedirectPermanent dans htaccess. En tapant par exemple : http://www.habitat-sante.org/acariens, on aboutit sur la page http://www.habitat-sante.org/FR/html/acariens/. Ce qui m'ennuie un peu, c'est qu'avec une redirection de ce type, c'est correct lorsque que l'internaute ne met pas un "/" après "acariens", sinon la redirection place un second "/" dans l'URL. L'affichage de la page n'est plus correct. Devrais-je modifier mon RedirectPermanent ou alors utiliser l'url-rewriting pour corriger ce problème ? Merci d'avance pour votre aide
  9. Bonjour, L'administrateur système et réseau de ma boite vient d'acheter un nouveau serveur pour le site Internet et il en a profité pour installer Apache 2. Bon... On est en phase de test et il semble que 1 .htaccess (simple protection d'un répertoire par mot de passe) ne soit carrément pas pris en compte Y-a-t-il quelque chose à modifier dans la config a priori ?
  10. Bonjour à tous! Voilà j'ai terminé mon site, hebergé sur wanadoo, et je viens d'acheter un nom en .fr, j'ai epluché l'aide mais je ne comprends pas comment faire pour que l'adresse wanadoo soit redirigée vers .fr, bref installé le nom de domaine quoi! Si ce topic a deja été crée, veuillez m'excuser! Merci Emma
  11. Bonsoir, J'ai récupéré un site sous lycos : http://membre.lycos.fr/site en suite j'ai acheté un nom de domaine site.com aujourdh'ui il y a encore quelques adresse de positionnée sur google de la forme : membre.lycos.fr/site un pint essentiel : je vais bientot ne plus avoir accés à l'hébergementde lycos ( il appartient à l'ancien proprio) 1- quoi faire : une redirection permanente 301 ou de l'url rewritting ? et comment faire car je ne sais ni faire l'un ni l'autre. Ensuite j'avais programmé en asp et je me suis apperçu que c'est vraiment pas pratique , du coup j'avais des adresses de la frame principale en : http://www.site.com/topic.asp?p=&topicid=61&visdt2=&vish2=... et des www.site.com/index.asp?haut..... , je suis en train de refaire le site et donc encore une fois, mais là je garde le même hébergeur , je fais quoi : 301 ou rewritting ? et comment faire ?car je ne sais maitrise absolument pas. merci de m'informé , c'est un ptit peu urgent bonne soirée.
  12. Bonjour et merci d'avance pour votre aide, J'ai une page qui commence par un formulaire, sur ce formulaire il y a 3 menus déroulant qui permettent une redirection vers différentes pages du site. J'ai trouvé le script suivant qui me permet de faire une redirection : Le formulaire : <FORM method="POST" action="redirect.php"> <select NAME="Liste"> <option selected="selected" value="">-Sélectionnez votre destination-</option> <option value="bleu">Bleu</option> <option value="blanc">Blanc</option> <option value="rouge">Rouge</option> </select> <input type="submit" name="envoi" value="envoyer" /> </FORM> La page de redirection redirect.php: <?php switch($_POST['ListeCouleur']){ case "bleu": header("Location: [url="http://www.bleu.com");"]http://www.bleu.com");[/url] break; case "blanc": header("Location: [url="http://www.blanc.com");"]http://www.blanc.com");[/url] break; case "rouge": header("Location: [url="http://www.rouge.com");"]http://www.rouge.com");[/url] break; default: header("Location: abc.htm"); } ?> Mon problème est de savoir comment écrire ma page redirect.php si j'ai plusieurs menu déroulant ? EXEMPLE : Mon formulaire contient 2 menus déroulants ListeCouleur et ListeNombre: <FORM method="POST" action="redirect.php"> <select NAME="ListeCouleur"> <option selected="selected" value="">-Sélectionnez votre destination-</option> <option value="bleu">Bleu</option> <option value="blanc">Blanc</option> <option value="rouge">Rouge</option> </select> <select NAME="ListeNombre"> <option selected="selected" value="">-Sélectionnez votre destination-</option> <option value="un">un</option> <option value="deux">deux</option> <option value="trois">trois</option> </select> <input type="submit" name="envoi" value="envoyer" /> </FORM> J'AI ESSAYE DE FAIRE CECI ? Mais çà ne fonctionne pas parfaitment, alors je viens vous demander votre aide, merci :-) <?php switch($_POST['ListeCouleur']){ case "bleu": header("Location: [url="http://www.bleu.com");"]http://www.bleu.com");[/url] break; case "blanc": header("Location: [url="http://www.blanc.com");"]http://www.blanc.com");[/url] break; case "rouge": header("Location: [url="http://www.rouge.com");"]http://www.rouge.com");[/url] break; default: header("Location: abc.htm"); } switch($_POST['ListeNombre']){ case "un": header("Location: [url="http://www.un.com");"]http://www.un.com");[/url] break; case "deux": header("Location: [url="http://www.deux.com");"]http://www.deux.com");[/url] break; case "trois": header("Location: [url="http://www.trois.com");"]http://www.trois.com");[/url] break; } ?> Merci
  13. Bonjour, Je viens de tomber, à ma grande stupeur, sur le clone de mon site à peine mis en ligne ! C'est exactement mon site de jeux (en signature) mais avec une autre adresse !! h***** [édit]j'ai enlevé l'adresse de redirection de peur que ça nuise à mon site. On sait jamais...[/édit] Je ne comprend pas. Les liens pointent vers mon site, mais à l'arrivée, l'url est la même et le site sous une pub... Je voulais leur envoyer un mail, mais c'est moi qui le reçoit !!? Gribouille
  14. Bonjour, Connaissez vous un outil capable de savoir si un site fait l'objet d'une redirection ( involontaire) Je souffre de ce probléme qui semble trés préjudiciable à son référencement alors que mes webmasters n'ont pas fait de redirection à ma connaissance bien que certains outils du net me disent " votre site doit faire l'objet d'une redirection " C'est rageant et incompréhensible.. Que faire pour être sur ? Merci Australien( a l'ouest) PS le site est là
  15. 2sous

    Redirection

    Bonjour, mon hébergeur a récemment plié boutique. Il m'avait donné une adresse : www.monsite.ici.sc Celle-ci était inscrite dans de nombreux annuaires. Dernièrement, j'ai pris un hébergement payant avec un nom de domaine en .com Est-il possible de faire une redirection du www.monsite.ici.sc vers www.monsite.com Merci
  16. bonjour j'ai commencé a utiliser le .HTACCESS , j'ai testé un dossier sur mon site : j'ai mis le fichier .HTACCESS dans ce dossier test AuthUserFile [/home/users/fa/hm19000/www/www.doublecanon.be/.htpasswd] AuthGroupFile /dev/null AuthName "Accès protégé" AuthType Basic <LIMIT GET POST> Require valid-user </LIMIT> et j'ai mis le fichier .htpasswd dans la recine du site avec : p:p (user:mot de passe ) mais ca ne marche pas . je sais pourquoi , peut etre j'ai oublié quelque chose.
  17. Bonjour, Comme certains j'ai profitté des Freedoms d'OVH pour acquérir plusieur noms de domaines en rapport avec mon site/forum principal . - Est ce que le fait d'en mettre certains en alias, cat dire en redirection automatique vers mon domaine principale est autorisé par Google ? - Si pour plusieurs autres je crée des mini-sites pertinents hébergés sur mon serveur et ayant chacun un thème mais avec le but inavoué de les référencer et d'y placer des liens vers mon forum, cela est-il permis ? Merci de vos conseils.
  18. slt je voudrais protéger l'accès à la partie admin de mon site. http://www.monsite.com/admin j'ai donc mis un .htaccess dans le dossier admin avec le code suivant : AuthUserFile [/mounted-storage/home15a/sub003/sc17693-HUVK/monsite.com/admin/.htpasswd] AuthGroupFile /dev/null AuthName "Accès restreint" AuthType Basic <Limit GET POST> require valid-user </Limit> et le .htpasswd toujours ds le dossier admin : admin:Motdepassecrypté Le problème que je rencontre, c'est qu'on dirait qu'il ne reconnait pas le mot de passe ou comme si il était faux. Voyez vous quelques choses? Merci à vous
  19. Bonsoir, Je rencontre un problème curieux avec la réecriture des url. Jusqu'à présent je n'avais jamais rencontré de soucis sur aucun poste (testé une bonne 10aine de config, postes, endroits différents), mais l'un de mes visiteurs a pris la peine de m'avertir qu'il était impossible d'accéder aux pages des sous-rubriques, celles sur lesquelles j'ai appliqué l'url rewrinting. La personne utilise IE ou Mozilla, le problème est le même, et il n'y a apparemment pas de code d'erreur renvoyé (404,500,etc...) le seul message est: Impossible d'afficher la page Voici le code du fichier htaccess: ErrorDocument 401 http://www.site.com/404.php ErrorDocument 403 http://www.site.com/404.php RewriteEngine On RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f RewriteRule ^.+\.php$ http://www.site.com/404.php ErrorDocument 404 http://www.site.com/404.php RewriteEngine On RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f RewriteRule ^.+\.php$ http://www.site.com/404.php RewriteEngine On RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f RewriteRule ^.+\.php$ http://www.site.com/404.htm Options +FollowSymlinks RewriteEngine on RewriteRule ^page-(.+)-([0-9]+).html$ page.php3?rub=$1&idrub=$2 [L] si quelqu'un voit l'erreur, ou sait de quoi cette erreur peut provenir ...
  20. Salut j'ai du charger mon nom de domaine en urgence mais maintenant se pose un proble je perd tous mes liens comment faire en sorte que quelques soit la page de www.machin.com soit redirigé vers www.truc.com et urml rewriting que les pages existe ou non j'aimerais toutes les faire pointer vers www.truc.com merci a tous je suis vraiment dans le caca
  21. Bonjour à tous !!! Je suis en train de créer un site web pour ma mère et j'y est introduit un formulaire de contacte pour les clients. Voici l'adresse du site que j'utilise pour tester différent éléments http://nicolas703.ifrance.com. J'ai demandé à mon hebergeur le ficier Formmail.pl que j'ai introduis sur mon serveur dans le ficher cgi-bin. Maintenand je voudrais savoir comment le configurer pour que le formulaire fonctionne. Voici le code source de mon fichier Formmail.pl #!/usr/bin/perl -w ############################################################################## # FormMail Version 1.92 # # Copyright 1995-2002 Matt Wright mattw_AT_scriptarchive.com # # Created 06/09/95 Last Modified 04/21/02 # # Matt's Script Archive, Inc.: [url="http://www.scriptarchive.com/"]http://www.scriptarchive.com/[/url] # ############################################################################## # COPYRIGHT NOTICE # # Copyright 1995-2002 Matthew M. Wright All Rights Reserved. # # # # FormMail may be used and modified free of charge by anyone so long as this # # copyright notice and the comments above remain intact. By using this # # code you agree to indemnify Matthew M. Wright from any liability that # # might arise from its use. # # # # Selling the code for this program without prior written consent is # # expressly forbidden. In other words, please ask first before you try and # # make money off of my program. # # # # Obtain permission before redistributing this software over the Internet or # # in any other medium. In all cases copyright and header must remain intact. # ############################################################################## # ACCESS CONTROL FIX: Peter D. Thompson Yezek # # [url="http://www.securityfocus.com/archive/1/62033"]http://www.securityfocus.com/archive/1/62033[/url] # ############################################################################## # Define Variables # # Detailed Information Found In README File. # # $mailprog defines the location of your sendmail program on your unix # # system. The flags -i and -t should be passed to sendmail in order to # # have it ignore single dots on a line and to read message for recipients # $mailprog = '/usr/sbin/sendmail -i -t'; # _AT_referers allows forms to be located only on servers which are defined # # in this field. This security fix from the last version which allowed # # anyone on any server to use your FormMail script on their web site. # _AT_referers = ('portesin.ch'); # _AT_recipients defines the e-mail addresses or domain names that e-mail can # # be sent to. This must be filled in correctly to prevent SPAM and allow # # valid addresses to receive e-mail. Read the documentation to find out how # # this variable works!!! It is EXTREMELY IMPORTANT. # _AT_recipients = &fill_recipients(@referers); # ACCESS CONTROL FIX: Peter D. Thompson Yezek # # _AT_valid_ENV allows the sysadmin to define what environment variables can # # be reported via the env_report directive. This was implemented to fix # # the problem reported at [url="http://www.securityfocus.com/bid/1187"]http://www.securityfocus.com/bid/1187[/url] # _AT_valid_ENV = ('REMOTE_HOST','REMOTE_ADDR','REMOTE_USER','HTTP_USER_AGENT'); # Done # ############################################################################## # Check Referring URL &check_url; # Retrieve Date &get_date; # Parse Form Contents &parse_form; # Check Required Fields &check_required; # Send E-Mail &send_mail; # Return HTML Page or Redirect User &return_html; # NOTE rev1.91: This function is no longer intended to stop abuse, that # # functionality is now embedded in the checks made on _AT_recipients and the # # recipient form field. # sub check_url { # Localize the check_referer flag which determines if user is valid. # local($check_referer) = 0; # If a referring URL was specified, for each valid referer, make sure # # that a valid referring URL was passed to FormMail. # if ($ENV{'HTTP_REFERER'}) { foreach $referer (@referers) { if ($ENV{'HTTP_REFERER'} =~ m|https?://([^/]*)$referer|i) { $check_referer = 1; last; } } } else { $check_referer = 1; } # If the HTTP_REFERER was invalid, send back an error. # if ($check_referer != 1) { &error('bad_referer') } } sub get_date { # Define arrays for the day of the week and month of the year. # _AT_days = ('Sunday','Monday','Tuesday','Wednesday', 'Thursday','Friday','Saturday'); _AT_months = ('January','February','March','April','May','June','July', 'August','September','October','November','December'); # Get the current time and format the hour, minutes and seconds. Add # # 1900 to the year to get the full 4 digit year. # ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6]; $time = sprintf("%02d:%02d:%02d",$hour,$min,$sec); $year += 1900; # Format the date. # $date = "$days[$wday], $months[$mon] $mday, $year at $time"; } sub parse_form { # Define the configuration associative array. # %Config = ('recipient','', 'subject','', 'email','', 'realname','', 'redirect','', 'bgcolor','', 'background','', 'link_color','', 'vlink_color','', 'text_color','', 'alink_color','', 'title','', 'sort','', 'print_config','', 'required','', 'env_report','', 'return_link_title','', 'return_link_url','', 'print_blank_fields','', 'missing_fields_redirect',''); # Determine the form's REQUEST_METHOD (GET or POST) and split the form # # fields up into their name-value pairs. If the REQUEST_METHOD was # # not GET or POST, send an error. # if ($ENV{'REQUEST_METHOD'} eq 'GET') { # Split the name-value pairs _AT_pairs = split(/&/, $ENV{'QUERY_STRING'}); } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { # Get the input read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs _AT_pairs = split(/&/, $buffer); } else { &error('request_method'); } # For each name-value pair: # foreach $pair (@pairs) { # Split the pair up into individual variables. # local($name, $value) = split(/=/, $pair); # Decode the form encoding on the name and value variables. # # v1.92: remove null bytes # $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $name =~ tr/\0//d; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/\0//d; # If the field name has been specified in the %Config array, it will # # return a 1 for defined($Config{$name}}) and we should associate # # this value with the appropriate configuration variable. If this # # is not a configuration form field, put it into the associative # # array %Form, appending the value with a ', ' if there is already a # # value present. We also save the order of the form fields in the # # _AT_Field_Order array so we can use this order for the generic sort. # if (defined($Config{$name})) { $Config{$name} = $value; } else { if ($Form{$name} ne '') { $Form{$name} = "$Form{$name}, $value"; } else { push(@Field_Order,$name); $Form{$name} = $value; } } } # The next six lines remove any extra spaces or new lines from the # # configuration variables, which may have been caused if your editor # # wraps lines after a certain length or if you used spaces between field # # names or environment variables. # $Config{'required'} =~ s/(\s+|\n)?,(\s+|\n)?/,/g; $Config{'required'} =~ s/(\s+)?\n+(\s+)?//g; $Config{'env_report'} =~ s/(\s+|\n)?,(\s+|\n)?/,/g; $Config{'env_report'} =~ s/(\s+)?\n+(\s+)?//g; $Config{'print_config'} =~ s/(\s+|\n)?,(\s+|\n)?/,/g; $Config{'print_config'} =~ s/(\s+)?\n+(\s+)?//g; # Split the configuration variables into individual field names. # _AT_Required = split(/,/,$Config{'required'}); _AT_Env_Report = split(/,/,$Config{'env_report'}); _AT_Print_Config = split(/,/,$Config{'print_config'}); # ACCESS CONTROL FIX: Only allow ENV variables in _AT_valid_ENV in # # _AT_Env_Report for security reasons. # foreach $env_item (@Env_Report) { foreach $valid_item (@valid_ENV) { if ( $env_item eq $valid_item ) { push(@temp_array, $env_item) } } } _AT_Env_Report = _AT_temp_array; } sub check_required { # Localize the variables used in this subroutine. # local($require, _AT_error); # The following insures that there were no newlines in any fields which # # will be used in the header. # if ($Config{'subject'} =~ /(\n|\r)/m || $Config{'email'} =~ /(\n|\r)/m || $Config{'realname'} =~ /(\n|\r)/m || $Config{'recipient'} =~ /(\n|\r)/m) { &error('invalid_headers'); } if (!$Config{'recipient'}) { if (!defined(%Form)) { &error('bad_referer') } else { &error('no_recipient') } } else { # This block of code requires that the recipient address end with # # a valid domain or e-mail address as defined in _AT_recipients. # $valid_recipient = 0; foreach $send_to (split(/,/,$Config{'recipient'})) { foreach $recipient (@recipients) { if ($send_to =~ /$recipient$/i) { push(@send_to,$send_to); last; } } } if ($#send_to < 0) { &error('no_recipient') } $Config{'recipient'} = join(',',@send_to); } # For each require field defined in the form: # foreach $require (@Required) { # If the required field is the email field, the syntax of the email # # address if checked to make sure it passes a valid syntax. # if ($require eq 'email' && !&check_email($Config{$require})) { push(@error,$require); } # Otherwise, if the required field is a configuration field and it # # has no value or has been filled in with a space, send an error. # elsif (defined($Config{$require})) { if ($Config{$require} eq '') { push(@error,$require); } } # If it is a regular form field which has not been filled in or # # filled in with a space, flag it as an error field. # elsif (!defined($Form{$require}) || $Form{$require} eq '') { push(@error,$require); } } # If any error fields have been found, send error message to the user. # if (@error) { &error('missing_fields', _AT_error) } } sub return_html { # Local variables used in this subroutine initialized. # local($key,$sort_order,$sorted_field); # Now that we have finished using form values for any e-mail related # # reasons, we will convert all of the form fields and config values # # to remove any cross-site scripting security holes. # local($field); foreach $field (keys %Config) { $safeConfig{$field} = &clean_html($Config{$field}); } foreach $field (keys %Form) { $Form{$field} = &clean_html($Form{$field}); } # If redirect option is used, print the redirectional location header. # if ($Config{'redirect'}) { print "Location: $safeConfig{'redirect'}\n\n"; } # Otherwise, begin printing the response page. # else { # Print HTTP header and opening HTML tags. # print "Content-type: text/html\n\n"; print "<html>\n <head>\n"; # Print out title of page # if ($Config{'title'}) { print "<title>$safeConfig{'title'}</title>\n" } else { print "<title>Thank You</title>\n" } print " </head>\n <body"; # Get Body Tag Attributes # &body_attributes; # Close Body Tag # print ">\n <center>\n"; # Print custom or generic title. # if ($Config{'title'}) { print "<h1>$safeConfig{'title'}</h1>\n" } else { print "<h1>Thank You For Filling Out This Form</h1>\n" } print "</center>\n"; print "Below is what you submitted to $safeConfig{'recipient'} on "; print "$date<p><hr size=1 width=75\%><p>\n"; # If a sort order is specified, sort the form fields based on that. # if ($Config{'sort'} =~ /^order:.*,.*/) { # Set the temporary $sort_order variable to the sorting order, # # remove extraneous line breaks and spaces, remove the order: # # directive and split the sort fields into an array. # $sort_order = $Config{'sort'}; $sort_order =~ s/(\s+|\n)?,(\s+|\n)?/,/g; $sort_order =~ s/(\s+)?\n+(\s+)?//g; $sort_order =~ s/order://; _AT_sorted_fields = split(/,/, $sort_order); # For each sorted field, if it has a value or the print blank # # fields option is turned on print the form field and value. # foreach $sorted_field (@sorted_fields) { local $sfname = &clean_html($sorted_field); if ($Config{'print_blank_fields'} || $Form{$sorted_field} ne '') { print "<b>$sfname:</b> $Form{$sorted_field}<p>\n"; } } } # Otherwise, use the order the fields were sent, or alphabetic. # else { # Sort alphabetically if requested. if ($Config{'sort'} eq 'alphabetic') { _AT_Field_Order = sort _AT_Field_Order; } # For each form field, if it has a value or the print blank # # fields option is turned on print the form field and value. # foreach $field (@Field_Order) { local $fname = &clean_html($field); if ($Config{'print_blank_fields'} || $Form{$field} ne '') { print "<b>$fname:</b> $Form{$field}<p>\n"; } } } print "<p><hr size=1 width=75%><p>\n"; # Check for a Return Link and print one if found. # if ($Config{'return_link_url'} && $Config{'return_link_title'}) { print "<ul>\n"; print "<li><a href=\"$safeConfig{'return_link_url'}\">$safeConfig{'return_link_title'}</a>\n"; print "</ul>\n"; } # Print the page footer. # print <<"(END HTML FOOTER)"; <hr size=1 width=75%><p> <center><font size=-1><a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.92 © 1995 - 2002 Matt Wright<br> A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a></font></center> </body> </html> (END HTML FOOTER) } } sub send_mail { # Localize variables used in this subroutine. # local($print_config,$key,$sort_order,$sorted_field,$env_report); # Open The Mail Program open(MAIL,"|$mailprog"); print MAIL "To: $Config{'recipient'}\n"; print MAIL "From: $Config{'email'} ($Config{'realname'})\n"; # Check for Message Subject if ($Config{'subject'}) { print MAIL "Subject: $Config{'subject'}\n\n" } else { print MAIL "Subject: WWW Form Submission\n\n" } print MAIL "Below is the result of your feedback form. It was submitted by\n"; print MAIL "$Config{'realname'} ($Config{'email'}) on $date\n"; print MAIL "-" x 75 . "\n\n"; if (@Print_Config) { foreach $print_config (@Print_Config) { if ($Config{$print_config}) { print MAIL "$print_config: $Config{$print_config}\n\n"; } } } # If a sort order is specified, sort the form fields based on that. # if ($Config{'sort'} =~ /^order:.*,.*/) { # Remove extraneous line breaks and spaces, remove the order: # # directive and split the sort fields into an array. # local $sort_order = $Config{'sort'}; $sort_order =~ s/(\s+|\n)?,(\s+|\n)?/,/g; $sort_order =~ s/(\s+)?\n+(\s+)?//g; $sort_order =~ s/order://; _AT_sorted_fields = split(/,/, $sort_order); # For each sorted field, if it has a value or the print blank # # fields option is turned on print the form field and value. # foreach $sorted_field (@sorted_fields) { if ($Config{'print_blank_fields'} || $Form{$sorted_field} ne '') { print MAIL "$sorted_field: $Form{$sorted_field}\n\n"; } } } # Otherwise, print fields in order they were sent or alphabetically. # else { # Sort alphabetically if specified: # if ($Config{'sort'} eq 'alphabetic') { _AT_Field_Order = sort _AT_Field_Order; } # For each form field, if it has a value or the print blank # # fields option is turned on print the form field and value. # foreach $field (@Field_Order) { if ($Config{'print_blank_fields'} || $Form{$field} ne '') { print MAIL "$field: $Form{$field}\n\n"; } } } print MAIL "-" x 75 . "\n\n"; # Send any specified Environment Variables to recipient. # foreach $env_report (@Env_Report) { if ($ENV{$env_report}) { print MAIL "$env_report: $ENV{$env_report}\n"; } } close (MAIL); } sub check_email { # Initialize local email variable with input to subroutine. # $email = $_[0]; # If the e-mail address contains: # if ($email =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ || # the e-mail address contains an invalid syntax. Or, if the # # syntax does not match the following regular expression pattern # # it fails basic syntax verification. # $email !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z0-9]+)(\]?)$/) { # Basic syntax requires: one or more characters before the @ sign, # # followed by an optional '[', then any number of letters, numbers, # # dashes or periods (valid domain/IP characters) ending in a period # # and then 2 or 3 letters (for domain suffixes) or 1 to 3 numbers # # (for IP addresses). An ending bracket is also allowed as it is # # valid syntax to have an email address like: user@[255.255.255.0] # # Return a false value, since the e-mail address did not pass valid # # syntax. # return 0; } else { # Return a true value, e-mail verification passed. # return 1; } } # This was added into v1.91 to further secure the recipients array. Now, by # # default it will assume that valid recipients include only users with # # usernames A-Z, a-z, 0-9, _ and - that match your domain exactly. If this # # is not what you want, you should read more detailed instructions regarding # # the configuration of the _AT_recipients variable in the documentation. # sub fill_recipients { local(@domains) = _AT__; local($domain,@return_recips); foreach $domain (@domains) { if ($domain =~ /^\d+\.\d+\.\d+\.\d+$/) { $domain =~ s/\./\\\./g; push(@return_recips,'^[\w\-\.]+\@\[' . $domain . '\]'); } else { $domain =~ s/\./\\\./g; $domain =~ s/\-/\\\-/g; push(@return_recips,'^[\w\-\.]+\@' . $domain); } } return _AT_return_recips; } # This function will convert <, >, & and " to their HTML equivalents. # sub clean_html { local $value = $_[0]; $value =~ s/\&/\&/g; $value =~ s/</\</g; $value =~ s/>/\>/g; $value =~ s/"/\"/g; return $value; } sub body_attributes { # Check for Background Color if ($Config{'bgcolor'}) { print " bgcolor=\"$safeConfig{'bgcolor'}\"" } # Check for Background Image if ($Config{'background'}) { print " background=\"$safeConfig{'background'}\"" } # Check for Link Color if ($Config{'link_color'}) { print " link=\"$safeConfig{'link_color'}\"" } # Check for Visited Link Color if ($Config{'vlink_color'}) { print " vlink=\"$safeConfig{'vlink_color'}\"" } # Check for Active Link Color if ($Config{'alink_color'}) { print " alink=\"$safeConfig{'alink_color'}\"" } # Check for Body Text Color if ($Config{'text_color'}) { print " text=\"$safeConfig{'text_color'}\"" } } sub error { # Localize variables and assign subroutine input. # local($error,@error_fields) = _AT__; local($host,$missing_field,$missing_field_list); if ($error eq 'bad_referer') { if ($ENV{'HTTP_REFERER'} =~ m|^https?://([\w\.]+)|i) { $host = $1; my $referer = &clean_html($ENV{'HTTP_REFERER'}); print <<"(END ERROR HTML)"; Content-type: text/html <html> <head> <title>Bad Referrer - Access Denied</title> </head> <body bgcolor=#FFFFFF text=#000000> <center> <table border=0 width=600 bgcolor=#9C9C9C> <tr><th><font size=+2>Bad Referrer - Access Denied</font></th></tr> </table> <table border=0 width=600 bgcolor=#CFCFCF> <tr><td>The form attempting to use <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> resides at <tt>$referer</tt>, which is not allowed to access this cgi script.<p> If you are attempting to configure FormMail to run with this form, you need to add the following to \@referers, explained in detail in the <a href="http://www.scriptarchive.com/readme/formmail.html">README</a> file.<p> Add <tt>'$host'</tt> to your <tt><b>\@referers</b></tt> array.<hr size=1> <center><font size=-1> <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.92 © 1995 - 2002 Matt Wright<br> A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a> </font></center> </td></tr> </table> </center> </body> </html> (END ERROR HTML) } else { print <<"(END ERROR HTML)"; Content-type: text/html <html> <head> <title>FormMail v1.92</title> </head> <body bgcolor=#FFFFFF text=#000000> <center> <table border=0 width=600 bgcolor=#9C9C9C> <tr><th><font size=+2>FormMail</font></th></tr> </table> <table border=0 width=600 bgcolor=#CFCFCF> <tr><th><tt><font size=+1>Copyright 1995 - 2002 Matt Wright<br> Version 1.92 - Released April 21, 2002<br> A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a></font></tt></th></tr> </table> </center> </body> </html> (END ERROR HTML) } } elsif ($error eq 'request_method') { print <<"(END ERROR HTML)"; Content-type: text/html <html> <head> <title>Error: Request Method</title> </head> <body bgcolor=#FFFFFF text=#000000> <center> <table border=0 width=600 bgcolor=#9C9C9C> <tr><th><font size=+2>Error: Request Method</font></th></tr> </table> <table border=0 width=600 bgcolor=#CFCFCF> <tr><td>The Request Method of the Form you submitted did not match either <tt>GET</tt> or <tt>POST</tt>. Please check the form and make sure the <tt>method=</tt> statement is in upper case and matches <tt>GET</tt> or <tt>POST</tt>.<p> <center><font size=-1> <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.92 © 1995 - 2002 Matt Wright<br> A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a> </font></center> </td></tr> </table> </center> </body> </html> (END ERROR HTML) } elsif ($error eq 'no_recipient') { print <<"(END ERROR HTML)"; Content-type: text/html <html> <head> <title>Error: Bad/No Recipient</title> </head> <body bgcolor=#FFFFFF text=#000000> <center> <table border=0 width=600 bgcolor=#9C9C9C> <tr><th><font size=+2>Error: Bad/No Recipient</font></th></tr> </table> <table border=0 width=600 bgcolor=#CFCFCF> <tr><td>There was no recipient or an invalid recipient specified in the data sent to FormMail. Please make sure you have filled in the <tt>recipient</tt> form field with an e-mail address that has been configured in <tt>\@recipients</tt>. More information on filling in <tt>recipient</tt> form fields and variables can be found in the <a href="http://www.scriptarchive.com/readme/formmail.html">README</a> file.<hr size=1> <center><font size=-1> <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.92 © 1995 - 2002 Matt Wright<br> A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a> </font></center> </td></tr> </table> </center> </body> </html> (END ERROR HTML) } elsif ($error eq 'invalid_headers') { print <<"(END ERROR HTML)"; Content-type: text/html <html> <head> <title>Error: Bad Header Fields</title> </head> <body bgcolor=#FFFFFF text=#000000> <center> <table border=0 width=600 bgcolor=#9C9C9C> <tr><th><font size=+2>Error: Bad Header Fields</font></th></tr> </table> <table border=0 width=600 bgcolor=#CFCFCF> <tr><td>The header fields, which include <tt>recipient</tt>, <tt>email</tt>, <tt>realname</tt> and <tt>subject</tt> were filled in with invalid values. You may not include any newline characters in these parameters. More information on filling in these form fields and variables can be found in the <a href="http://www.scriptarchive.com/readme/formmail.html">README</a> file.<hr size=1> <center><font size=-1> <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.92 © 1995 - 2002 Matt Wright<br> A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a> </font></center> </td></tr> </table> </center> </body> </html> (END ERROR HTML) } elsif ($error eq 'missing_fields') { if ($Config{'missing_fields_redirect'}) { print "Location: " . &clean_html($Config{'missing_fields_redirect'}) . "\n\n"; } else { foreach $missing_field (@error_fields) { $missing_field_list .= "<li>" . &clean_html($missing_field) . "\n"; } print <<"(END ERROR HTML)"; Content-type: text/html <html> <head> <title>Error: Blank Fields</title> </head> <center> <table border=0 width=600 bgcolor=#9C9C9C> <tr><th><font size=+2>Error: Blank Fields</font></th></tr> </table> <table border=0 width=600 bgcolor=#CFCFCF> <tr><td>The following fields were left blank in your submission form:<p> <ul> $missing_field_list </ul><br> These fields must be filled in before you can successfully submit the form.<p> Please use your browser's back button to return to the form and try again.<hr size=1> <center><font size=-1> <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.92 © 1995 - 2002 Matt Wright<br> A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a> </font></center> </td></tr> </table> </center> </body> </html> (END ERROR HTML) } } exit; } Merci d'avance pour votre aide <Edit Modérateur : Merci d'utiliser la balise CODEBOX pour les portions de code un peu "longues"
  22. Bonjour j'aimerais savoir s'il faut mettre un fichier index dans chaque dossier, si oui pourquelle raison ? Et dans un deuxieme temps s'il faut mettre un fichier index dans chaque dossier est il possible grace au fichier .htaccess d'arriver au meme résultat sans avoir a mettre un fichier index dans chaque dossier du style je me conntecte a machin.com/truc... index n'existe pas mais grace a .htaccess je suis redirigé sur la page d'accueil ou faut il toujours avoir un index dans chaque dossier pour eviter que les gens n'arrivent dans le dossier sur l'index of" qui permet d'avoir acces aux autres dossiers et fichiers ?
  23. Bonjour, Voici un extrait de mon .htaccess. RewriteRule ^t([0-9]*)_([A-Za-z0-9-]*)\.htm index.php?showtopic=$1&furl=yes [L] RewriteRule ^t([0-9]*)_([0-9]*)_([A-Za-z0-9-]*)\.htm index.php?showtopic=$1&st=$2&furl=yes [L] RewriteRule ^f([0-9]*)_([A-Za-z0-9-]*)\.htm index.php?showforum=$1&furl=yes [L,E=furl:yes] RewriteRule ^f([0-9]*)_([0-9]*)_([A-Za-z0-9-]*)\.htm index.php?showforum=$1&st=$2&furl=yes [L,E=furl:yes] RewriteRule ^viewtopic_([0-9]*)_([0-9]*).html index.php?act=ST&f=$1&t=$2&s= [L] RewriteRule ^pagef_([0-9]*)_([0-9]*)_([0-9]*).html index.php?s=&act=SF&f=$1&prune_day=$2&sort_by=Z-A&sort_order=&st=$3 [L] RewriteRule ^paget_([0-9]*)_([0-9]*)_([0-9]*).html index.php?s=&act=ST&f=$1&t=$2&st=$3 [L] En fait ce qui me pose probleme, c'est la premiere regle. Ca me repond toujors erreur dans le lien demande. RewriteRule ^t([0-9]*)_([A-Za-z0-9-]*)\.htm index.php?showtopic=$1&furl=yes [L] Cette regle ne fonctionne pas alors que celle ci : RewriteRule ^paget_([0-9]*)_([0-9]*)_([0-9]*).html index.php?s=&act=ST&f=$1&t=$2&st=$3 [L] fonctionne. J'ai essaye plein de trucs. J'ai meme essaye RewriteRule ^t([0-9]*).htm http://ww.MONDOMAIN.com [L] mais ca marche pas alors j'ai duplique la ligne qui marche et je l'ai modiee comme suit, mais ca marche toujours pas. RewriteRule ^page2t_([0-9]*).html index.php?s=&act=ST&f=10&t=$1&st=0 [L] Par contre si je mets directement dans firefox ca marche http://www.MOMDOMAINE.com/forum/index.php?s=&act=ST&f=10&t=NUMERO&st=0 C'est un peu comme si je pouvais pas ajouter de regles, les anciennes fonctionnes, les nouvelles non. Voyez vous une erreur dans mon code ?
  24. Dan avait déjà couvert une partie du sujet avec ses articles sur .htaccess, mais il m'a semblé qu'il serait utile de faire une synthèse des techniques de redirection. Le Hub vient de publier : Les redirections : à quoi ça sert, comment ça marche ? Vos critiques seront les bienvenues.
  25. Bonjour l'équipe et les membres de Webmaster HUB, Voilà j'ai un petit problème avec mon nouveau site internet : http://www.gregdp.com J'aimerai mettre des bords rond dans mon cadre contenu. Le problème c'est que je n'arrive pas à les fixer ! Pouvez vous m'aider svp ? PS : voici le site sans la redirection : http://pagesperso.laposte.net/bof/ Désolé si ce n'est pas le bon endroit pour poster mais je ne savais où le mettre !? Vous pouvez aussi le critiquer le plus possible, ça m'aidera ! Merci d'avance !
×
×
  • Créer...