So I'm trying to write a mod_rewrite rule that will send everything on my main domain to a subdomain.
For example, redirect
http://example.com/1/2/3/4/5?n=6&i=7
to
http://sub.example.com/1/2/3/4/5?n=6&i=7
Here's what I have so far:
RewriteEngine On
RewriteCond ^http://www\.example.com\/ [NC]
RewriteRule ^(.*)$ http://sub.example.com/$1 [R=301,L]
But it doesn't seem to working. Any tips?