RewriteEngine On
RewriteBase /iptv/api/player/

# EPG routes
# /api/player/{user}/{pass}/epg/short/{stream_id}
# /api/player/{user}/{pass}/epg/full/{stream_id}
# /api/player/{user}/{pass}/epg/full/all
RewriteRule ^([^/]+)/([^/]+)/epg/short/([0-9]+)/?$ epg.php?username=$1&password=$2&type=short&stream_id=$3 [L,QSA]
RewriteRule ^([^/]+)/([^/]+)/epg/short/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/?$ epg.php?username=$1&password=$2&type=short&stream_id=$3&offset=$4&limit=$5&page=$6 [L,QSA]
RewriteRule ^([^/]+)/([^/]+)/epg/full/all/?$ epg.php?username=$1&password=$2&type=full_all [L,QSA]
RewriteRule ^([^/]+)/([^/]+)/epg/full/([0-9]+)/?$ epg.php?username=$1&password=$2&type=full&stream_id=$3 [L,QSA]
