//file api.php $func = strtolower(trim(str_replace("/","",$_REQUEST['rquest']))); //sửa thành - $func = strtolower(trim(str_replace("/ws/","",$_SERVER['REQUEST_URI']))); .htaccess RewriteRule ^(.*)$ api.php?rquest=$1 [QSA,NC,L] //thành RewriteRule ^(.*)$ api.php?$1 [QSA,NC,L] //Lưu ý là api phải nằm trong thư mục ws, nếu change thì thay thu muc $func = strtolower(trim(str_replace("//","",$_SERVER['REQUEST_URI'])));