Forum Moderators: phranque
ROOT .htaccess (applicable lines)
RewriteCond $1 !^(sitemap\.xml|sitemap\.xml\.gz|robots\.txt)$
# All other requests to...
RewriteRule ^(.*)$ http://blog.example.com/$1 [R=301,L]
# Sitemap redirection
Redirect 301 /sitemap.xml http://blog.example.com/sitemap.xml
Redirect 301 /sitemap.xml.gz http://blog.example.com/sitemap.xml.gz
ROOT robots.txt (applicable line)
#Sitemap
Sitemap: http://blog.example.com/sitemap.xml.gz
==============================
BLOG .htaccess (applicable lines)
# Sitemap redirection
Redirect 301 /sitemap.xml http://blog.example.com/sitemap.xml
Redirect 301 /sitemap.xml.gz http://blog.example.com/sitemap.xml.gz
BLOG robots.txt (applicable line)
# Sitemap
Sitemap: http://blog.example.com/sitemap.xml.gz
[edited by: phranque at 7:12 pm (utc) on Jun 28, 2013]
[edit reason] unlinked & exemplified urls [/edit]
when there are Redirect and RewriteRule directives in the same scope, the RewriteRule directives will run first, regardless of the order of appearance in the configuration file.