How to track subdomains with Google Analytics while having mod_rewrite redirect to a subdomain?
- by Marek
When users come directly to domain.com or www.domain.com, I am redirecting them to shop.domain.com via this .htaccess rewrite:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule ^(.*)$ http://shop.domain.com/ [R=301,L]
The content served by shop.domain.com has the following tracking…