I have a site that was previously located at www.example.com
I'm trying to now redirect all www.example.com/whateverpage requests to online.example.com/whateverpage instead.
The redirects are working in flipping things over to the online.mysite.com subdomain, but are redirecting to the non-aliased versions, i.e.
http://www.example.com/whateverpage
goes to:
http:
//online.example.com/?q=whateverpage
instead of:
http:
//online.example.com/whateverpage
as desired.
furthermore there is apparently some duplicate content issues,
I'd imagine this is related to my incompetence working with .htaccess and rewrite rules in general, but alas I'm lost and hoping for some tips. My rewrite rules look like:
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
RewriteCond %{HTTP_HOST} !^online.example.com$ [NC]
RewriteRule ^(.*)$ http://online.example.com/$1 [L,R=301]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.(html?|php)(\?[^\ ]*)?\ HTTP/
RewriteRule ^(([^/]*/)*)index\.(html?|php)$ http://online.example.com/$1 [R=301,L]
The initial RewriteCond's in the default .htaccess files seem to reference that sort of thing (I think?), but commenting them out/messing around with them doesn't seem to do the trick...
Any suggestions much appreciated!
Thanks.
[edited by: incrediBILL at 2:38 am (utc) on May 23, 2012]
[edit reason] fixed URL format [/edit]