Apache /htaccess forward entire site except a few custom pages
This method demonstrates when you would like to redirect an entire site but would like to show something such as a “We have a new web site” page on the existing domain. For instance if your site is moving from http://foo.com to http://bar.com but you want people to be greeted at http://foo.com with a “Our site is new and improved and now belongs at http://bar.com, you will be redirected there in a moment.” Also if you have additional pages that need to be excluded from the redirect such as an about page or contact page, this method will work too. This same code also has a few pages that are redirected to a new relevant page.
The following code needs to go in your hosts.conf or your htaccess file. I would recommend putting it .htaccess over your hosts.conf since it is web site specific and not apache specific and would just clutter up your hosts.conf file.
# These lines should go before the rewrite condition below so that they are listened to first
# This says redirect http://foo.com/about.html -> http://bar.com/about-us, notice the page name has changed and we don't want to just dump them out onto the home
Redirect /about.html http://www.bar.com/about-us
Redirect /contact.html http://www.bar.com/contact-us
Redirect /sitemap.html http://www.bar.com/sitemap
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{request_uri} !^/(index|contact|about|sitemap)\.(asp|html|htm)$
# says no! for the pages listed which would be index.html/asp/htm, contact.asp/htm/html since we want those other pages to listen to the redirects above and the index will be excluded so it can be delivered from the site.
RewriteRule (.*\.(asp|htm|html)) http://www.example.com/arts-culture [R=301,L]
# this line dumps the remaining requests that don't match any prior conditions to this specific page. Don't use this if you want the user to be dumped onto the new homepage.
RewriteRule (.*\.(asp|htm|html)) http://www.example.com/$1 [R=301,L]
# This is if you want to send over the page with the forward