我的.htaccess无法正常工作[关闭]

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".

This should be working, but as an alternative you could also use:

$url = $_SERVER['REQUEST_URI'];

Then you would not have to check if anything is set or pass a query variable in your rewrite rule.

Check if mod_rewrite is enabled, and also check if the webserver configuration allows to use .htaccess files - see http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride for a detailed explanation.