I am trying to redirect only my top level domain eg. domain.com to sub.domain.com. The inner pages of the domain should not be redirected.
I followed the following link: How to redirect root and only root via htaccess?
But when doing a search on my site, the query was appended to the sub domain like:
sub.domain.com/?q=product where it should have been domain.com/?q=product
My current htaccess already has to following that has rewritten:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !\.(png|gif|ico|swf|jpe?g|js|css)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php?sef_rewrite=1 [L,QSA]
What do I add to achieve the behaviour stated above?
RewriteRule ^/$ http://sub.domain.com? [R=301,L]but it is not redirecting. – JC Lee Apr 02 '13 at 12:37^$instead of^/$. – Shane Madden Apr 02 '13 at 20:43?from your configuration, then; as I mentioned in my answer, it's for if you want to remove the query string. – Shane Madden Apr 03 '13 at 15:51sub.domain.com? Is that correct? – Shane Madden Apr 05 '13 at 01:01