$link = $_SERVER['REQUEST_URI'];
$text = substr($link, strpos($link, "/") + 1);
echo $text;
try_files $uri $uri/ /index.php?q=$uri&$args;
$_SERVER['REQUEST_URI']
и напишите просто try_files $uri $uri/ /index.php;
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [QSA,L]