title: .htaccess: How to redirect all pages except admin to home page?
body: <p>I modified the home page to "under construction" page. Now I want to redirect all pages within the site to the "under construction" page except for the admin section. How can I do this with .htaccess?</p>
  
  <p>For instance, I want to redirect pages such as <code>www.mydomain.com/contact</code> or <code>www.mydomain.com/profile/services</code> to the home page. But I want to keep all admin pages such as <code>www.mydomain.com/admin</code> still accessible as I need to login to make changes.</p>
  
  <p>This is what I have:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  
  RewriteCond %{HTTP_HOST} !^www\.mydomain\.com
  RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME}/index.html !-f
  RewriteCond %{REQUEST_FILENAME}/index.php !-f
  RewriteRule . index.php [L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>I tried few different things but it does not seem to work.</p>