Newbie Needs Help with Mod Rewrite and 301s

Hi guys, thanks to anyone in advance who can provide any insight. I am a newbie with a question…

OK, so built a new site for a client in ModX and am using Mod_Rewrite for friendly URLs. Client has two domains with 2 A Records now pointing to the same ip address ( and This site replaces an existing site, so we had some 301s to set up. HTaccess file looks like:

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

then we set up some 301s. However, we need 301s for both domains.
one domain, had a default.aspx file that now needs to go to index.html on new site. We tried this:

redirect 301 /default.aspx

and the result when entering is the following:

So, can anyone provide any insight as to why we’re getting that query string on the end, which causes a 404 for us?


Thanks in advance…

Hi acaffiero,

Things on your server (or your description) are all messed up!

From your description, the Redirect will be performed first (because it’s part of the Apache core) so default.aspx should be redirected to From there (assuming .com is parked on or visa versa), there is NO way to be redirected to

If there was not a question about the change of domain names, I’d suggest that index.html did not exist (otherwise, there would have been no redirection to index.php).

Please clarify:

  1. Co-location of the two domains

  2. Existence of index.html