Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it L'avatar di dottwatson
    Registrato dal
    Feb 2007
    Messaggi
    3,012

    [htaccess] controllo redirect su QUERY_STRING senza query string

    salve,

    come da titolo ho questo codice

    codice:
    RewriteEngine on
    RewriteCond %{QUERY_STRING} ^opt=ciccio$
    RewriteRule /* http://www.dominio.net/pagina_interessata.php [R=301,L]
    il quale lavora egregiamente.

    l'unica cosa è, però, che mi accoda al link di destinazione la query string, che a me serve SOLO per fare il match di reindirizzamento...

    cosa sbaglio?

    grazie
    Non sempre essere l'ultimo è un male... almeno non devi guardarti le spalle

    il mio profilo su PHPClasses e il mio blog laboweb

  2. #2
    Utente di HTML.it L'avatar di Enoa
    Registrato dal
    Jul 2005
    Messaggi
    573
    hai provato aggiungendo un "?"?
    codice:
    RewriteEngine on
    RewriteCond %{QUERY_STRING} ^opt=ciccio$
    RewriteRule /* http://www.dominio.net/pagina_interessata.php? [R=301,L]
    http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html

    Modifying the Query String

    By default, the query string is passed through unchanged. You can, however, create URLs in the substitution string containing a query string part. Simply use a question mark inside the substitution string to indicate that the following text should be re-injected into the query string. When you want to erase an existing query string, end the substitution string with just a question mark. To combine new and old query strings, use the [QSA] flag.

  3. #3
    Utente di HTML.it L'avatar di dottwatson
    Registrato dal
    Feb 2007
    Messaggi
    3,012
    grazie enoa... e pure il link mi sono preso che la docs ufficiale non guasta mai!!!


    Non sempre essere l'ultimo è un male... almeno non devi guardarti le spalle

    il mio profilo su PHPClasses e il mio blog laboweb

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.