How to redirect all website pages to one page using the htaccess file

I was asked by a client to temporarily shutdown his website and display an under maintenance mode page.  Now if this was a wordpress site then it would have been a piece a cake.  I would have just installed a maintenance plugin and activated it and all the pages would have been redirected to the maintenance mode page. But this was an html site.  And at first thought, you would think that you could just upload a new index.html page that has some text on it that says the site is currently under maintenance.  But the problem with that is that you can still access all the internal pages. Another option would have been to move all the files and pages into a new folder or zipped folder so there is no trace of the original pages.  This creates a problem also.  Your pages could get de-indexed from the search engines and it would take some time to get them indexed again when the site goes back up. So I wanted to just change the .htaccess file to redirect all the pages to a specific one.  There are a lot of htaccess codes out there that say this is the code that does that but most of them don’t work to redirect all pages.  So here is the correct code to place in your .htaccess file. RewriteEngine On RewriteCond...

Read More