I have this .htaccess below, with my rule, my index.php is my default, is where I acess all, where I want to do my navigation, this index also recover variable url:
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1
Then I have my function getHome() to handle url, for now Im just echo my $url, that was supposed to get the value passed by url:
function getHome(){
$url = $_GET['url'];
echo $url;
}
Than I have my index.php where Im calling my getHome(), and for now Im testing, passing some values on my url.
But when I pass some random values into my url, I'm getting always "Object not found!....Error 404"
But I wanted to echo my values that I passed in the URL.
Do you see what am I doing wrong?
Update:
Im had a <?
instread of <?php
in my code, and now Im having an error:
Notice: Undefined index: url in $url = $_GET['url'];
I update my function to:
$url = isset($_GET['url']);
And now I dont have undefined index error, but I have the same error before, when I pass some random values to my URL, I always get my "Object not found...Error 404".