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 (invapay.com and invapay.co.uk). 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, invapay.co.uk had a default.aspx file that now needs to go to index.html on new site. We tried this:

redirect 301 /default.aspx http://www.invapay.co.uk/index.html

and the result when entering www.invapay.co.uk/default.aspx is the following:

http://www.invapay.com/index.html?q=default.aspx

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

Thanx

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 http://www.invapay.co.uk/index.html. From there (assuming .com is parked on .co.uk or visa versa), there is NO way to be redirected to invapay.com/index.html?q=default.aspx.

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

Regards,

DK