mode rewrite error
Good Afternoon i have a question to make if anyone can help me please 

I'm using mode rewrite in my new website my first model is 

.htaccess file

    RewriteEngine On
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?rwr=$1

index.php file

    if (isset($_REQUEST['rwr'])) {
        if (substr($_REQUEST['rwr'], -1) == "/") {
            $modrewrite = substr($_REQUEST['rwr'], 0, -1);
        } else {
            $modrewrite = $_REQUEST['rwr'];
        }
        $modrewrite = explode("/", $modrewrite);
    }
    if (isset($modrewrite) && $modrewrite[0] != "") {
        $category = $modrewrite[0];
    } else {
        $category = null;
    }
    
    if (isset($modrewrite[1])) {
        $service = $modrewrite[1];
    } else {
        $service = null;
    }
    
    if (isset($modrewrite[2])) {
        $identification = $modrewrite[2];
    } else {
        $identification = null;
    }

With this the link www.domain.com/service/webdesign/works go to - 

    $category = "service";
    $service = "webdesign";
    $identification = "works";

**This is working but i want to optimize this to** 

.htaccess file

    RewriteEngine on
    RewriteRule ^(.*)/(.*)/(.*)$ index.php?category=$1&service=$2&identification=$3

index.php file 

    $category = $_GET['category'];
    $service = $_GET['service'];
    $identification = $_GET['identification'];

But dont work why? anyone can help me?


mode rewrite error
===

Good Afternoon i have a question to make if anyone can help me please 

I'm using mode rewrite in my new website my first model is 

.htaccess file

    RewriteEngine On
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?rwr=$1

index.php file

    if (isset($_REQUEST['rwr'])) {
        if (substr($_REQUEST['rwr'], -1) == "/") {
            $modrewrite = substr($_REQUEST['rwr'], 0, -1);
        } else {
            $modrewrite = $_REQUEST['rwr'];
        }
        $modrewrite = explode("/", $modrewrite);
    }
    if (isset($modrewrite) && $modrewrite[0] != "") {
        $category = $modrewrite[0];
    } else {
        $category = null;
    }
    
    if (isset($modrewrite[1])) {
        $service = $modrewrite[1];
    } else {
        $service = null;
    }
    
    if (isset($modrewrite[2])) {
        $identification = $modrewrite[2];
    } else {
        $identification = null;
    }

With this the link www.domain.com/service/webdesign/works go to - 

    $category = "service";
    $service = "webdesign";
    $identification = "works";

**This is working but i want to optimize this to** 

.htaccess file

    RewriteEngine on
    RewriteRule ^(.*)/(.*)/(.*)$ index.php?category=$1&service=$2&identification=$3

index.php file 

    $category = $_GET['category'];
    $service = $_GET['service'];
    $identification = $_GET['identification'];

But dont work why? anyone can help me?

