Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > it.comp.www.php > #21188

Re: htaccess strani

From Greg <greg@alicie.com>
Newsgroups it.comp.www.php
Subject Re: htaccess strani
Date 2016-09-27 23:13 +0200
Organization solani.org
Message-ID <nsendq$o5a$1@solani.org> (permalink)
References (3 earlier) <51558857-0abd-461d-89c4-164fe1b52a75@googlegroups.com> <nsc53k$50v$1@solani.org> <fb8acb18-4886-48e3-86d9-0b00f1131111@googlegroups.com> <nsdmej$nc$1@solani.org> <7f466c7f-fb8b-4b1b-8631-1696eecedc71@googlegroups.com>

Show all headers | View raw


Il 27/09/2016 19:38:02 fmassei@gmail.com ha scritto:
> On Tuesday, September 27, 2016 at 7:50:45 AM UTC-4, Greg wrote:
>> la cusiosità di sapere come fa aranzulla a ripulire slash multipli a fine url
>> mentre altri siti no
>> 
>
> Se usi apache qualcosa di questo tipo nello .htaccess dovrebbe andare (magari
> ricontrolla le regexp, dovrei aver preso tutti i casi, ma non so):
>
> # rimuovi slash spuri all'inizio (controllando sulla stringa di richiesta, che
> # altrimenti hai l'URI ripulito in testa)
> RewriteCond %{THE_REQUEST} ^[A-Z]+\s//+(.*)\sHTTP/[0-9.]+$ [OR]
> RewriteCond %{THE_REQUEST} ^[A-Z]+\s(.*/)/+\sHTTP/[0-9.]+$
> RewriteRule .* http://%{HTTP_HOST}/%1 [R=301,L]
>
> # rimuovi dallo URI qualsiasi altro slash doppio
> RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
> RewriteRule . %1/%2 [R=301,L]
>
> Non dovrebbe essere difficile far funzionare questa roba anche nel caso ti serva
> un redirect fisso ad una pagina (come il tipico tutto allo index.php) o tu sia
> sotto virtualhost, ma prima d'usarlo in produzione controlla.
>
> Ciao!

Questa funziona, grazie :)
Ma è difficile anche solo leggerla, non dico capirla.
Domani voglio provare a decifrarla con la tabella dei simboli davanti

-- 
Greg

Back to it.comp.www.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

htaccess strani Greg <greg@alicie.com> - 2016-09-26 11:43 +0200
  Re: htaccess strani fmigliori <fmigliori@gmail.com> - 2016-09-26 02:51 -0700
    Re: htaccess strani Greg <greg@alicie.com> - 2016-09-26 14:55 +0200
      Re: htaccess strani fmigliori <fmigliori@gmail.com> - 2016-09-26 10:24 -0700
        Re: htaccess strani Greg <greg@alicie.com> - 2016-09-26 21:16 +0200
          Re: htaccess strani "ciccio" <21669invalid@mynewsgate.net> - 2016-09-26 19:31 +0000
        Re: htaccess strani fmassei@gmail.com - 2016-09-26 14:04 -0700
  Re: htaccess strani fmassei@gmail.com - 2016-09-26 12:42 -0700
    Re: htaccess strani Greg <greg@alicie.com> - 2016-09-26 22:31 +0200
      Re: htaccess strani fmassei@gmail.com - 2016-09-26 13:48 -0700
        Re: htaccess strani Greg <greg@alicie.com> - 2016-09-26 23:48 +0200
          Re: htaccess strani fmassei@gmail.com - 2016-09-26 15:10 -0700
            Re: htaccess strani Greg <greg@alicie.com> - 2016-09-27 13:50 +0200
              Re: htaccess strani Alessandro Pellizzari <shuriken@amiran.it> - 2016-09-27 13:13 +0100
              Re: htaccess strani fmassei@gmail.com - 2016-09-27 10:38 -0700
                Re: htaccess strani Greg <greg@alicie.com> - 2016-09-27 23:13 +0200
                Re: htaccess strani fmassei@gmail.com - 2016-09-27 18:49 -0700
                Re: htaccess strani Greg <greg@alicie.com> - 2016-09-28 10:23 +0200
                Re: htaccess strani fmassei@gmail.com - 2016-09-28 10:45 -0700
                Re: htaccess strani Greg <greg@alicie.com> - 2016-09-28 10:27 +0200

csiph-web