Forum Moderators: phranque
Options +FollowSymlinks
RewriteEngine on
Rewritecond %{HTTP_HOST} ^oldsite.com [NC]
Rewriterule ^(.*)$ http://www.newsite.com/$1 [R=301,NC]
RewriteCond %{HTTP_HOST} ^www.oldsite.com [NC]
RewriteRule ^(.*)$ http://www.newsite.com/$1 [L,R=301] http://www.htaccesseditor.com/en.shtml#a_redirect redirect 301 /index.html http://www.newsite.com/ Options +FollowSymlinks
RewriteEngine on
Rewritecond %{HTTP_HOST} ^oldsite.com/page.html [NC]
Rewriterule ^(.*)$ http://www.newsite.com/page.html$1 [R=301,NC]
RewriteCond %{HTTP_HOST} ^www.oldsite.com/page.html [NC]
RewriteRule ^(.*)$ http://www.newsite.com/page.html$1 [L,R=301]
Rewritecond %{HTTP_HOST} ^oldsite.com [NC]
Rewriterule ^(.*)$ http://www.newsite.com/$1 [R=301,NC]
RewriteCond %{HTTP_HOST} ^www.oldsite.com [NC]
RewriteRule ^(.*)$ http://www.newsite.com/$1 [L,R=301]
[olddomain.com...] => [newdomain.com...]
RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /index\.html([?#][^\ ]*)?\ HTTP/
RewriteRule ^index\.html$ http://www.example.com/ [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^/]+/)*index\.html([?#][^\ ]*)?\ HTTP/
RewriteRule ^(([^/]+/)*)index\.html$ http://www.example.com/$1 [R=301,L]