The problem i am facing is that i have a wild card domain where by i want to redirect all subdomain to a particular url i.e.
http://subdomain.domain.com --> http://www.domain.com/pagination.php?id=subdomain&page=1
similarly if
http://subdomain.domain.com/page-2 --> http://www.domain.com/pagination.php?id=subdomain&page=2
and if product id is given i.e.
http://subdomain.domain.com/some_product_name-123 --> http://www.domain.com/productview.php?id=123
My htaccess file is
RewriteCond %{http_host} .
RewriteCond %{http_host} !^www.pricesinpakistan.com.pk [NC]
RewriteCond %{http_host} ^([^.]+)\.pricesinpakistan.com.pk [NC]
RewriteRule page-^([^/]*)$ pagination.php?id=%1&page=$2 [L]
RewriteRule ^(.*)$ pagination.php?id=%1&page=1 [L]
The above rule is not catering the page rule all redirects are done on last rule with empty string as id.