If you need to redirect all the pages of your website to the homepage, while still having access to the admin area you need to add some code to the .htaccess file that resides in the main directory of your website.
While doing this, please make sure that you do not overwrite the default WordPress code for “pretty” permalinks.
Just add the following code above the one you will find in the .htaccess file.