These below work fine and i do have dynamic subdomains working.... RewriteEngine On RewriteCond %{HTTP_HOST} ^([^.]+)\.mydomain\.com?$ RewriteRule ^$ search.php?q=%1 [QSA,L] RewriteEngine On RewriteRule ^(.*)/(.*)/(.*)/$ search.php?q=$1&t=$2&s=$3 [QSA,L] But what i would like to get to work is something like RewriteEngine On RewriteCond %{HTTP_HOST} ^([^.]+)\.mydomain\.com/([^.]+)/([^.]+)/?$ RewriteRule ^$ search.php?q=%1&t=%2&s-%3 [QSA,L] Basically the subdomain would be 1 of the search parameters and then the 2 sobfolders are the other 2 search parameters. is it possible?
Combine your two blocks of rewrite code like this: RewriteEngine On RewriteCond %{HTTP_HOST} ^([^.]+)\.mydomain\.com?$ RewriteRule ^/([^/]+)/([^/]+)/?$ search.php?q=[b][color=red]%1[/color][/b]&t=[b][color=green]$1[/color][/b]&s=[b][color=green]$2[/color][/b] [QSA,L] Code (markup): %1 from RewriteCond, and $1 and $2 from RewriteRule pattern matches. But whats that '?' doing there after domain name (mydomain\.com?$)? You should remove that.