Forum Moderators: phranque
Redirect 301 / http://www.newdomain.com/
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . / [L,R=301]
I think this is the way to do this
Redirect 301 / http://www.example.com/
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . / [L,R=301]
RewriteRule (/|\.html)$ / [R=301,L] RewriteCond %{REQUEST_URI} !index\.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (/|\.html)$ http://www.example.com/ [R=301,L] RewriteRule ^({list-of-specific-pages-here}) http://www.example.org/$1 [R=301,L]
RewriteRule (/|\.html|^)$ http://www.example.org/special-new-page.html [R=301,L]
RewriteRule ^({list-of-specific-pages-here})?$ http://www.example.org/special-new-page.html [R=301,L]
RewriteRule (/|\.html)$ http://www.example.org/$1 [R=301,L]
RewriteRule ^(hovercraft|fonts|fun|ebooks|paintings|silence)(/index\.html)?$ http://example.com/$1/ [R=301,L]
RewriteRule ^((?:hovercraft|fonts|fun|ebooks|paintings|silence)/.*) http://example.com/$1? [R=301,L] in a few days all indexed pages of the old site will disappear from Google
Redirect 301 /index.php http://www.newdomain.com/
Redirect 301 /dir/subdir/page1 http://www.newdomain.com/
Redirect 301 /dir/subdir/page2 http://www.newdomain.com/
Redirect 301 /dir/subdir/page3 http://www.newdomain.com/
...
RewriteRule ^({list-of-specific-pages-here}) http://www.example.org/$1? [R=301,L]
RewriteRule (/|\.html|^)$ http://www.example.org/special-new-page.html? [R=301,L] RewriteRule ^(([^/]+/)*)index\.html http://www.example.org/$1 [R=301,L,NS]
RewriteCond %{HTTP_HOST} !^(www\.example\.org)?$
RewriteRule ^(.*)$ http://www.example.org/$1 [R=301,L]
What I now also notice is that the homepage of the old site now is indexed with the title and description of the new site
RewriteRule ^paintings/rats/(addrodent|catenary|hovercraft| howyousay|northstar|nuqqarit| pride|pusiruluk|snocone| snow|translation|uranium)\.html http://example.com/paintings/northrats/$1\.html [R=301,L] RewriteRule ^ebooks/(hale|downy|rambles|ninelives|christmas|grandmother)/ - [G]
www.olddomain.be (the exact page there is www.olddomain.be/index.php)
www.olddomain.be/nl/keyword1 (“keyword1” is not really a directory but a rewrite of keyword1.html)
www.olddomain.be/nl/directory1/keyword2
www.olddomain.be/nl/directory1/keyword3
www.olddomain.be/nl/directory2/keyword4
www.olddomain.be/wordpressblog/blogpost1 (“blogpost1” is not really a directory but a rewrite of the blogpost pagename done by Wordpress)
www.olddomain.be/wordpressblog/blogpost2
….
actually we want to redirect all the content pages of our old site (about 40 or so) with a 301 to the new site in the hopes to transfer some pagerank, linking credit,… to the new site but also because most of the visitors of those pages will actually want to see our new site.
All the other pages of the old site (like the page with the terms, privacy policy, pages with content that’s irrelevant to the new site,…) will get the 404 page.
# 1
RewriteRule ^(boilerplate|contact|info) - [G] # 1b
RewriteCond %{REQUEST_URI} !(chocolate|cigars|calendars)
RewriteRule ^sales - [G] # 1c
RewriteRule ^hotels/(Brussels|Antwerp) - [G] # 2
RewriteRule ^index\.php http://www.example.org/ [R=301,L] # 3
RewriteRule (.*) http://www.example.org/$1 [R=301,L] And the only page that still has to remain in the serps is www.newdomain.com.
www.domain.be (the exact page there is www.domain.be/index.php)
www.domain.be/nl/keyword1 (“keyword1” is not really a directory but a rewrite of keyword1.html)
www.domain.be/nl/directory1/keyword2
www.domain.be/nl/directory1/keyword3
www.domain.be/nl/directory2/keyword4
www.domain.be/wordpressblog/blogpost1 (“blogpost1” is not really a directory but a rewrite of the blogpost pagename done by Wordpress)
www.domain.be/wordpressblog/blogpost2
ErrorDocument 410 /itsgone.html We want those 7 pages to get redirected with a 301 to the root
RewriteRule ^(index\.php)?$ http://www.example.com/ [R=301,L]
RewriteRule ^nl/directory1/(keyword1|keyword2|keyword3) http://www.example.com/directory1/$1 [R=301,L]
RewriteRule ^nl/directory2/keyword4 http://www.example.com/directory2/keyword4 [R=301,L]
RewriteRule ^wordpressblog/(blogpost1|blogpost2) http://www.example.com/wordpressblog/$1 [R=301,L] RewriteRule . - [G]