0
I have the following situation, when the URL
no values after bar http://www.meusite.com/
and I type something in the search http://www.meusite.com/?s=teste
includes my result page, now when the URL
has values http://www.meusite.com/minha-pagina/?s=teste
does not include my results page, how could I arrange this?
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1
$dir = "views/arch";
if (isset($_GET['url'])) :
$url = addslashes($_GET['url']);
$sep = explode('/', $url);
endif;
$pg = array('contato');
if (isset($_GET['s'])) :
require_once (''.$dir.'/search.php');
elseif (isset($sep[0]) && $sep[0] == 'filter') :
require_once (''.$dir.'/filtro.php');
elseif (isset($sep[1])) :
require_once (''.$dir.'/categoria.php');
elseif (isset($sep[0]) && in_array($sep[0], $pg)) :
require_once (''.$dir.'/'.$sep[0].'.php');
else :
require_once (''.$dir.'/home.php');
endif;
Related: URL friendly, how to make it work with HTACCESS
– Icaro Martins
Related: Passing variables through the URL using friendly URL via GET
– Icaro Martins
Related: Doubt about htaccess
– Icaro Martins