I want to make all URLs of the site belong to the root domain.com even the assets, and only categories in sub domains
example
domain.com/
domain.com/join.php
domain.com/admin/
games.domain.com/
games.domain.com/arcade/
games.domain.com/arcade/10.html
each of these url take from ===
domain.com/ === index.php
domain.com/join.php === join.php
domain.com/admin/ === /admin/
games.domain.com/ === main_categories.php?slug=games
games.domain.com/arcade/ === sub_categories.php?slug=games&cat=arcade
games.domain.com/arcade/10.html === view.php?slug=games&cat=arcade&id=10
I have this code but its not working
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.domain.com
RewriteCond %{HTTP_HOST} ([a-zA-Z0-9-]+)\.domain.com
RewriteRule .* - [S=3]
RewriteRule ^(.*)$ main_categories.php?prefix=%1
RewriteRule ^([A-Za-z0-9-]+)/?((index|news|photos|videos|articles)\.html)?$ sub_categories.php?prefix=$1&type=$3 [QSA,L]
RewriteRule ^([A-Za-z0-9-]+)/([0-9-]+)/?(.*)?.html$ view.php?prefix=$1&id=$2&title=$3 [QSA,L]