Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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.

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

2 Answers

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]
</IfModule>
share|improve this answer
4  
Instead of a redirect, you could also consider sending a 503 and a Retry-After header... webmasters.stackexchange.com/a/55659/1243 –  w3d Feb 9 at 14:57
1  
@w3d: good point, you're right. –  Zistoloen Feb 9 at 21:41
add comment

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...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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