I am trying to set up canonical redirects in my .htaccess file in order to manage my domains. The situation is complicated by the fact that there is already a set of rewrite rules in place for the CMS, (Joomla). My approach was to not mark the canonical redirects as final, and to place them before the SEF rewite rule block for Joomla.

I added this block of instructions:

######### create canonical domains ##################

RewriteCond %{HTTP_HOST} ^3dify.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.3dify.com$ [OR]
RewriteCond %{HTTP_HOST} ^threedify.com$
RewriteRule ^/?(.*) "http://www.threedify.com/$1" [R=301,NC]

The result sort of works, in that a request for pages at 3dify.com, threedify.com, or www.3dify.com will always return http://www.threedify.com/index.php. The problem is that the rest of the URL is ignored instead of being appended to the new domain, so any request for a page at a non-canonical domain ALWAYS redirects to the site index.

This isn't what I want. I would like to return the requested page from the canonical URL, not redirect to the site root. Why is the $1 getting chomped? Does anyone have any ideas for me?

Thanks very much,

Chris Ivey, Marketing Director, ThreeDify