Hello, in my htaccess it looks like this:
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1
RewriteRule ^download/([A-Za-z0-9]+)$ index.php?a=download&k=$1 [QSA,L]
And in download.php
<?php
$k = $_GET['k'];
echo $k;
But this error returns when I access download/?k=aaaa
or download/?aaaa
Notice: Undefined index: k
index.php
<body>
<?php
require 'config/tratarUrl.php';
include $pag;
?>
</body>
treatUrl.php
<?php
$pUrl = strip_tags(trim(filter_input(INPUT_GET, 'url', FILTER_DEFAULT)));
$sUrl = (empty($pUrl) ? "index" : $pUrl);
$url = array_filter(explode('/', $sUrl));
if (count($url) > 1)
{
$cont = 1;
foreach ($url as $arg)
{
define("PARAM" . $cont, $arg);
$cont++;
}
}
else if (count($url) == 1)
{
if (file_exists(DIR_PAGES . $url[0] . '.php'))
{
$pag = DIR_PAGES . $url[0] . '.php';
}
else
{
if($url[0] != 'index')
{
$pag = DIR_PAGES . '404.php';
}
else
{
$pag = DIR_PAGES . 'home.php';
}
}
} else {
$pag = DIR_PAGES . '404.php';
}