Jump to content
MDDHosting Forums

Take my site off-line


Recommended Posts

Well, first thing you're going to want to do is make a simple webpage that tells your visitors your website is going to be unavailable for about a month. Take a look over Smashing Mag's article about these maintenance pages. Second thing you want to do not only for website security but SEO purposes is to temporarily redirect all traffic to that page. I'm not exactly what the exact syntax for this kind of redirection would be but I would highly recommend Apache Lounge and ask the questions about temporary redirection there. You're going to want to ask something along the lines of:

I'm doing website maintenance and I plan for my website to be offline for about a month. I have a maintenance page and a folder with the images for the page in it and I would like to know the best way how to do this through an htaccess file. All traffic would need to be directed to that page except for my IP address and I would like to reduce the damage this might have for SEO. Anyone have any suggestions?

 

What you definitely don't want to do is deny access to everything (a 404 error) which is going to kill your SEO like no tomorrow as well as estrange your clients. Apache Lounge is fairly active so you should get a response in less than a day. If they're unable to help, just post back in here for more help. I'm sure Mike will be along shortly to asnwer your question, but I thought I'd just put my two cents in. Good luck!

Link to comment
Share on other sites

SEO is basically a blanket term that refers how you are "seen" in the eyes of search engines like Google or Bing. Some sites have really good SEO where they might be the first website that comes up for the search term "soda," for example. Search engines don't like when they are going through your site and suddenly they can't get to anything that they could get to previously. Oftentimes, punishment for having that happen is that you will be appear lower in searches for your site or what you offer.
Link to comment
Share on other sites

The big search engines like Google and Bing each have pages where you can submit your site to be "crawled" and thus appear in search results.

 

You can submit your site for search for:

Google:

Bing:

Now that you've added you site to both search engines, it's important to know that nothing will happen instantly. It might take 2-3 days for you site to start showing up in searches specifically for you site and even longer for general keywords that your site might be applicable for.

Link to comment
Share on other sites

How can I take my site off-line(not live) while I make all the changes...maybe a month or so? Thanks

 

Kuemerle5 is right; the proper way to do it is to use a plain text file called ".htaccess" in your /public_html/ directory. Note that the file is a little strange to us Windows users; it starts with a dot. Some older versions of Windows will not allow you to create it that way on disk. If that's the case, you can create a "htaccess.txt" file and then rename it after uploading it using your FTP program.

 

I think this will work: create a plain text file on your local computer with these lines in it:

 

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule> 

 

Connect to your account with FTP, and see if there's already a ".htaccess" file in the /public_html/ folder. If there is, rename it to ".htaccess-old". Then upload your new ".htaccess" file.

 

Now, any URL on your site will be re-directed to the "index.html" file listed in the next to last line. (If you are using an "index.php" file, just edit the name there).

Link to comment
Share on other sites

Since we are on the subject, is there a way to forward all traffic to the home page while still having an admin have access to the site? I ask this because there are times where I need to work on my site while it's live but I don't want visitors viewing the site. I know I could password protect pages, but I would want SEO visitors who are coming to a random page being hit with a password prompt.
Link to comment
Share on other sites

Since we are on the subject, is there a way to forward all traffic to the home page while still having an admin have access to the site? I ask this because there are times where I need to work on my site while it's live but I don't want visitors viewing the site. I know I could password protect pages, but I would want SEO visitors who are coming to a random page being hit with a password prompt.

 

I don't know of one off-hand. You could always use the standard redirection in your index.php file in each folder, but have another "secret index file", say one named "home.php" or "home.html" for the admin. The admin could then reach into each directory by using that filename on the end of the URL: http://mydomain.com/home.php.

 

Its certainly not secure, and anyone with links deeper into the site will still be able to reach them. I think this is probably a case where you would just want to password protect the site (cPanel has an option to do this).

 

An example of an index.php page that redirects to the home page is:

 

<?php
Header("Location:http://mydomain.com");
?>

 

Any folder that is in will send the browser to the URL "http://mydomain.com".

 

There may be a way to do a redirect-for-all-but-one-IP address with some programming. I just don't know of any that are prebuilt.

Link to comment
Share on other sites

I just read a brief, not too complete explanation of how to deny all IP addresses except your own in .htaccess

 

Most of us are on "dynamic IPs" from our ISPs (which means we're allocated a different IP address each time we turn on our router). So this has the potential of locking you out of your site until you change the .htaccess using FTP. But, that being said, you could test this in a folder by placing a .htaccess file there with just these two lines in it:

 

Deny from all
Allow from xx.xxx.xx.xxx

 

Where "xx.xxx.xx.xxx" is your current IP address.

Link to comment
Share on other sites

Meh, I would shy away from doing a deny directive like that just because search bots hate running into those and visitors will get an ugly 'access denied' page. And if a search bot repeatedly gets denied from indexing a known page, it will begin removing pages which is what you don't want. I would say redirection with a temporary redirection http status code like a 302 or 307 would be your best bet.
Link to comment
Share on other sites

Meh, I would shy away from doing a deny directive like that just because search bots hate running into those and visitors will get an ugly 'access denied' page. And if a search bot repeatedly gets denied from indexing a known page, it will begin removing pages which is what you don't want. I would say redirection with a temporary redirection http status code like a 302 or 307 would be your best bet.

 

Not to mention getting locked out yourself if your modem resets for any reason (power outage, etc.) But it is possible to do it.

 

Depending on the length of the development cycle, Stocktrader's question is one I run into every now and then. How do I work on a site without having people visit it during development?

 

I usually just do it through obscurity, and renaming the pages afterward. IF I'm redoing an about page, I leave the current one in place and develop one with an obscure name, like "about-me-test.php". A search engine might crawl it, so I usually put a <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> directive in the head section. Anyone who knows the page can access it, but few know about it.

 

You do want to make sure and remove that meta directive when you rename the page. ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...