I have a problem I never had and I can’t find the reason.
I moved my site to another host and now it doesnt “read” the $_GET variables.
I have this url: http://whatever.com/path?filtro=si&provincia=Santa+Fe&localidad=Rosario
And if I call this:
$localidad = $_GET['localidad'];
$provincia = $_GET['provincia'];
$filtro = $_GET['filtro'];
echo $localidad;
echo "hola";
echo $provincia;
echo $filtro;
Nothing prints except “hola”, so there is no PHP error.
Here’s my .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Im working on a Wordpres site, perhaps it has something to do with Permalinks or something, Im really lost. Thank you very much, I appreciate your help.
EDIT
I renamed my .htacces so it wont read it and the page broke, so I went to permalink settings in wordpress and set them to
- Post Name http://luminias.com/index.php/example-page/
And now IT WORKS, but, now this is thw url:
http://whatever.com/index.php/path/?filtro=si&provincia=Santa+Fe&localidad=Rosario
And it prints all the $_GET, but I need that “/index.php/” gone..
Add
add_rewrite_tag
function in your function.php for all parameter :And you can call your parameter in template using
Here is the full documentation