if (!-e $request_filename){ rewrite ^/link/([^/]*)-([^/]*)/([^/]*)$ /wp-content/plugins/StupidPie/view/player/download.php?yttitle=$1&ytid=$2; rewrite ^/link/([^/]*)$ http://$http_host/link/$1/ permanent; }