Old 16-01-2009, 10:23   #1 (permalink)
bencharity
Student - Designer
 
Join Date: Dec 2008
Location: Kennesaw, GA
Posts: 31
htaccess allow/block question

I am building a website which is almost finished, so most of my files are online already. While my index page has no links to go further (it's an 'under construction' page) google is still indexing everything. This enables people to get into my site prior to its launch.

I want an htaccess that allows me, w3.org, and google bots to access the site, but everyone else to be bumped back to my construction page. I found this code:

Code:
AuthName "Under Development" AuthUserFile /home/askapache.com/.htpasswd AuthType basic Require valid-user Order Deny,Allow Deny from all Allow from 1.1.1.1 w3.org googlebot.com google.com google-analytics.com Satisfy Any

but I am such a beginner at htaccess, I'm not sure how to really tweak it for my needs so I couldn't get it to work. (I do understand at least that the 1.1.1.1 needs to by my IP)

So any help for someone who would like to learn would be great.

Thanks in advance!
Ben
  Reply With Quote
Old 16-01-2009, 10:47   #2 (permalink)
urbanbindi
Copy & Paste
 
urbanbindi's Avatar
 
Join Date: Jan 2009
Location: West London
Posts: 181
why not use the robots.txt protocol?
  Reply With Quote
Old 16-01-2009, 10:54   #3 (permalink)
bencharity
Student - Designer
 
Join Date: Dec 2008
Location: Kennesaw, GA
Posts: 31
Again, I'm a complete noob in this area. The htaccess is just what I found in reading through forums. Would you mind expanding on, or pointing me to a source that could help me?

Thanks urbanbindi
  Reply With Quote
Old 16-01-2009, 10:59   #4 (permalink)
urbanbindi
Copy & Paste
 
urbanbindi's Avatar
 
Join Date: Jan 2009
Location: West London
Posts: 181
Just out curiosity why would you want search engines to index the site if it's under construction? Surely thats bad because once the site goes live the old site files would have been cached in the search engines..

The robots example blocks search engines from indexing your site if its under construction or you can use it to block search engines from reading certain folders and directories in your website...

check this link out:

» 6 ways to stop Google and other search engines from indexing your site
  Reply With Quote
Old 16-01-2009, 11:02   #5 (permalink)
smart.1
Slave on a cotton field
 
smart.1's Avatar
 
Join Date: Jul 2008
Location: Cuckoo's nest
Posts: 189
You should move the hash file (.htpasswd) into a folder that is not accesible from the outside ( /home/.htpasswd), but this is only for restricting access to a folder. For other types of rules, you need only .htaccess
  Reply With Quote
Old 16-01-2009, 11:08   #6 (permalink)
bencharity
Student - Designer
 
Join Date: Dec 2008
Location: Kennesaw, GA
Posts: 31
Thanks so much for the link! I'll try it out.

As far as not stopping google, I can't really back up that desire. I've been trying to learn SEO from a guy and now it's got me all tip-toeing around google.

Thanks again for the direction!
  Reply With Quote
Old 16-01-2009, 13:07   #7 (permalink)
bencharity
Student - Designer
 
Join Date: Dec 2008
Location: Kennesaw, GA
Posts: 31
I tried a htpasswd and htaccess file to password protect cause this is supposed to stop people and google. But now it won't even let me in with my password.

I read about it here: Ilisys Web Hosting - How do I password protect a directory on a Linux server?

my htaccess is now this:

Code:
Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] AuthUserFile /home/content/g/r/a/gracelandcampus/html/.htpasswd AuthName "Restricted Area" AuthType Basic Require valid-user

and my htpasswd is:

Code:
webmaster:kG67cSW.9AldM guest:9g70P5DPIcQx2

They are both in my root folder (since until my launch I want to go ahead and block everything). Any clue as to why it won't let me in?
  Reply With Quote
Old 16-01-2009, 13:30   #8 (permalink)
herkalees
Semantics, yay.
 
Join Date: Nov 2005
Location: Beverly, Massachusetts
Posts: 1,534
I'm not sure I'd share your username and password here on a forum...

But, in a more helpful light, I wrote an article that may help. It's not your exact environment, but you'll be able to glean good instructions from it: Password-protect a Subdomain with Plesk at MarcAmos.com
__________________
  Reply With Quote
Old 16-01-2009, 13:35   #9 (permalink)
bencharity
Student - Designer
 
Join Date: Dec 2008
Location: Kennesaw, GA
Posts: 31
I am not really worried about security. There are no secrets up or anything, I merely don't want people stumbling on the project before it is launched (and I read that protecting it stops bots too). If it's that important to see it, they can.

And thanks for the link.
  Reply With Quote
Old 16-01-2009, 13:44   #10 (permalink)
bencharity
Student - Designer
 
Join Date: Dec 2008
Location: Kennesaw, GA
Posts: 31
So I've tried your instructions, and the ones from htaccesstools.com but I'm still not allowed in. I know that my absolute path is right, I got that from GoDaddy. Could there be an issue with my trying to protect my root folder?
  Reply With Quote
Old 16-01-2009, 14:09   #11 (permalink)
herkalees
Semantics, yay.
 
Join Date: Nov 2005
Location: Beverly, Massachusetts
Posts: 1,534
Quote:
Originally Posted by bencharity
So I've tried your instructions, and the ones from htaccesstools.com but I'm still not allowed in. I know that my absolute path is right, I got that from GoDaddy. Could there be an issue with my trying to protect my root folder?
Another option to consider, which is a huge departure from this method, is developing locally. Simply install something like WAMP or MAMP, and just make the whole thing on your computer until it's ready to launch.

As for there being an issue trying to protect root, there shouldn't be any limitations to that.
__________________
  Reply With Quote
Old 16-01-2009, 14:23   #12 (permalink)
bencharity
Student - Designer
 
Join Date: Dec 2008
Location: Kennesaw, GA
Posts: 31
Wow, how does that work? Basically sets up a faux server on an external? Where do you get that?

(sorry for so many questions, but this is all news to me and sounds great!)
  Reply With Quote
Old 16-01-2009, 14:29   #13 (permalink)
herkalees
Semantics, yay.
 
Join Date: Nov 2005
Location: Beverly, Massachusetts
Posts: 1,534
Quote:
Originally Posted by bencharity
Wow, how does that work? Basically sets up a faux server on an external? Where do you get that?

(sorry for so many questions, but this is all news to me and sounds great!)
Normally, it sets up a server (apache, mysql, php) on your hard drive, as if it were a program that you easily start and stop. Somewhere in it's preferences, you tell it what folder, on your hard drive, contains all of your website files, and once it's turned on, you go to http://localhost/ in your web browser and it just works. Most developers, in agencies, do it this way (with some sort of file-merge taking place nightly/weekly/etc.).

For windows: Install PHP 5 Apache MySQL on Windows : WampServer
For mac: living-e AG: MAMP - Mac - Apache - MySQL - PHP
__________________
  Reply With Quote
Old 16-01-2009, 14:32   #14 (permalink)
bencharity
Student - Designer
 
Join Date: Dec 2008
Location: Kennesaw, GA
Posts: 31
Wow. I mean this is awesome! I am grabbing MAMO Pro from living-e as I type this. I don't know how I haven't been using this! It's exactly what I've been needing!

Haha sorry about the gush, but this is totally awesome! It's like just finding out that there's such a thing as a refrigerator!
  Reply With Quote
Old 16-01-2009, 14:37   #15 (permalink)
herkalees
Semantics, yay.
 
Join Date: Nov 2005
Location: Beverly, Massachusetts
Posts: 1,534
Quote:
Originally Posted by bencharity
Wow. I mean this is awesome! I am grabbing MAMO Pro from living-e as I type this. I don't know how I haven't been using this! It's exactly what I've been needing!

Haha sorry about the gush, but this is totally awesome! It's like just finding out that there's such a thing as a refrigerator!
Yeah, it's great. It even works from outside a VM. For instance, on your mac, if you use VMWare Fusion, or Parallels, to run windows, all browsers within the windows instance can make use of MAMP even though it's running in the host OS (OS X).
__________________
  Reply With Quote
Old 16-01-2009, 14:42   #16 (permalink)
bencharity
Student - Designer
 
Join Date: Dec 2008
Location: Kennesaw, GA
Posts: 31
Oh really? So I can check my design in the pesky IE6 in Parallels all with mamp? I mean, it doesn't get much better than that.
  Reply With Quote
Old 16-01-2009, 14:43   #17 (permalink)
herkalees
Semantics, yay.
 
Join Date: Nov 2005
Location: Beverly, Massachusetts
Posts: 1,534
Quote:
Originally Posted by bencharity
Oh really? So I can check my design in the pesky IE6 in Parallels all with mamp? I mean, it doesn't get much better than that.
Yeah. In IE6 (inside of Parallels), you just go to your Mac's current IP address, like so: http://192.168.0.8/ (or whatever its IP is).
__________________
  Reply With Quote
Old 16-01-2009, 15:07   #18 (permalink)
bencharity
Student - Designer
 
Join Date: Dec 2008
Location: Kennesaw, GA
Posts: 31
Wow, much thanks man, what a great find!
  Reply With Quote
Old 16-01-2009, 15:16   #19 (permalink)
herkalees
Semantics, yay.
 
Join Date: Nov 2005
Location: Beverly, Massachusetts
Posts: 1,534
Sure thing.
__________________
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive
Web Hosting by Heart Internet, vBulletin © 2000-2009 Jelsoft Enterprises Limited.
Search Engine Optimization by vBSEO 3.0.0 RC8
Web Hosting by Heart Internet