I'm working on a project. I can upload a site files to the web server.

I have a site which is running. I want to update my site but I know visitors are coming 24 hours a day. So, how could I update my site without losing visitors?

When I visit big websites under maintenance, in general, I see some another page. I just want to do the same for my website.

Question Improved:

I want to update a whole site not only index.html, should I rename the index.html file to another name to not users come in the website or there is another solution without renaming the file.

I also dont have much idea about .htaccess file all I know is that it is used to redirect domains but I dont know how and what can I do to .htaccess so I dont have rename the index.html file.

  • Can you improve your question? It's hard to understand the current phrasing?
    – Osvaldo
    Feb 9 '14 at 9:20
  • 1
    Are you literally updating just "index.html" or the entire framework of your website?
    – MrWhite
    Feb 9 '14 at 14:59

If you want to notify your users that your site is under maintenance, you can temporarily redirect all your pages to a maintenance page with an .htaccess file (if you use Apache as a web server). To do this, add these lines in your .htaccess file:

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000 # no redirect for your IP
 RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC]
 RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
 RewriteRule .* /maintenance.html [R=302,L]

How about displaying a message in your main page with something like:

We are currently upgrading this website to serve your better. During this process you may continue browse our website using links below. Please let us know if your encounter any problem...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.