I have manually redirected my entire site. The only page that's left is the homepage. How do I redirect my homepage to the new site (http://example.com) but keep my sitemaps on the old domain (www.example.com)? Below is the structure for the sitemap urls:
Main - http://www.example.com/sitemap.xml
Sub - http://www.example.com/sitemap-pt-post-2013-07.xml (Month and year are the only parts that change)
I have tried this and the site redirects but GWT tells me that I dont have a 301 set:
RewriteEngine on
RewriteCond %{HTTP_HOST} olddomain\.com [NC]
RewriteCond %{REQUEST_URI} ^/$
Rewriterule ^(.*)$ http://newdomain.com/ [L,R=301]
P.S.
I want to do this so that I could track the 301 in GWT and etc. until things a finalized.
example.com
andwww.example.com
(one domain, different subdomains) but then useolddomain.com
andnewdomain.com
(two entirely different domains) in your code snippet? Presumably both domains are added to GWT?www.olddomain.com
andolddomain.com
- although it could probably be simplified (assuming you are already dealing with direct requests for the index document?).Redirect
directive work to redirect both the non-www and www versions to the new domain? Generally, you should not mix both mod_alias (Redirect
) and mod_rewrite (RewriteRule
) directives since the order of execution is not obvious and you can end up with unexpected conflicts. However, that probably isn't the problem in this case.