AddType x-mapp-php5 .php #[COLOR="#FF0000"]Required for 1and1 server which is php4 by default[/COLOR]
Options +FollowSymlinks
RewriteEngine On
Redirect 301 /index.php?route=product/product&product_id=51 http://www.newdomain.com/new-page
For posting here, I have changed the new domain name, but the rest of it is the code copied from the htaccess I wrote.
If I code it domain-to-domain, like this:
RewriteRule (.*) http://www.new.com/$1 [R=301,L]
the 301 works, but the page-to-page 301 is not working.
Second, I don’t believe Redirect can access the query string as your Redirect statement is attempting - you need mod_rewrite for that.
Third, (.*) will match EVERYTHING and redirect to new.com. It retains the {REQUEST_URI} variable as well as the {QUERY_STRING} so, if the scripts (including database and CMS configuration) are identical, it should work exactly the same at new.com.
Perhaps this is because of the query string problem, I don’t know. All the pages have the question mark. If so perhaps I need code that would fulfil this pseudo code:
QSA flag is what you need - it retains any query string when you’re creating a new query string, otherwise, it’ll be sent along anyway. In short, ARGH! You don’t want/need (.*)!
The new site has clean URLs. The question mark at the end of the destination URL is possibly just wrong and misleading but the code above is sending any URL with a query sting to the home page of the new destination site.