• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How do I redirect only index.php URLs to subdomain with htaccess/mod_rewrite?

I moved a XenForo installation to a subdomain and I need to redirect the old index.php links to the subdomain, for example:

Redirect this: http://example.com/index.php?threads/example.1/
to this: http://a.example.com/index.php?threads/example.1/

But I don't want to redirect anything other than index.php because there are other things that still need to be accessible, for example http://example.com/site/

I couldn't find an exact answer or figure out how but perhaps someone here knows how to do this so it can be done sooner