Skip to content

Instantly share code, notes, and snippets.

@alecrem
Last active December 18, 2015 05:48
Show Gist options
  • Save alecrem/5734947 to your computer and use it in GitHub Desktop.
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…
<?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