Last active
December 18, 2015 05:48
-
-
Save alecrem/5734947 to your computer and use it in GitHub Desktop.
Quitar los = de la URL cuando envías un formulario GET con checkboxes y quieres la URL un poco más corta.
— En vez de index.php?a=&b= conseguimos index.php?a&b
— Precaución 1: Se genera una petición más al servidor http y un proceso de PHP. — Precaución 2 por @gallir: si no quieres cargarte todos los signos = sino solo los que vienen tras las va…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(strpos($_SERVER['argv'][0], '=')){ | |
$newurl = 'Location: http://PON_ALGO_AQUI?' . str_replace('=', '', $_SERVER['argv'][0]); | |
header($newurl, true, 301); | |
die(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment