is it possible to have a static (non-Wordpress) html page that users will see if they browse to my domain.
at the same time, i want to be able to work on my WordPress site continue to make changes and see the results. So, browsing to http://www.mydomain.com/index.php would bring up my WordPress site, but http://www.mydomain.com would bring up the static HTML “under construction” page.
i understand that they is plugin for this, but is it possible to do it via htacess or sth.
like 301 redirect.
if so how do i write it into my htaccess file?
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase //
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
One way to solve this is to only show the website to admins. Your solution will not work for subpages, so people coming from direct links will still see your website.
If you put the above in functions.php, it will block non-admins from viewing any page at all that uses the theme. But you, as an admin, will be completely unimpeded.
(‘manage_options’ is a capability that only admins have by default. If you’ve messed with the capabilities you can either pick another admin exclusive capability or check the role explicitly, have a look at http://docs.appthemes.com/tutorials/wordpress-check-user-role-function/)