Solved

website hosting htaccess popup

Posted on 2014-12-23
9
93 Views
Last Modified: 2015-02-06
I have a website with pictures hosted on it.
I want to protect it using htaccess, so that means a box should pop if my site is accessed prompting a username and password.

The key thing is that NOBODY from anywhere, i.e  google should not be able to access the site OR the pictures.

In any case the user must be prompted to provide a username and password
0
Comment
Question by:Ikky786
  • 4
  • 4
9 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40515570
Add to the htaccess

AuthType Basic
AuthName "Some title for the authorisation box"
AuthUserFile /path_to_file/.htpasswd
Require valid-user

Open in new window


Create the .htpasswd file in the location you set above. and in this file add your users in the format
User1:Password1
User2:Password2
etc

Open in new window

0
 
LVL 4

Expert Comment

by:hulsebosch
ID: 40515650
To block Google from indexing, create a .htaccess file in your root dir.
# block google

RewriteEngine On

RewriteCond %{HTTP_USER_AGENT}   ^googlebot
RewriteRule ^/go/ - [F,L]

Open in new window

The word GO will be replaced with the folder you dont want indexed.
0
 
LVL 58

Expert Comment

by:Gary
ID: 40515676
You don't need to block Google et al as it will never get past the Authorisation.
And that is not how you block search bots anyway - thats what the robots.txt file was created for.
0
 
LVL 4

Expert Comment

by:hulsebosch
ID: 40515690
Gary,

robots.txt are not being obeid by all search bots (to bad). Thats why I gave this script.
It gives an option to secure from searchbots without having to login.
Still, you are very correct where it comes to autorisation blokking search engines.
(which was the actual question in the first place. My mistake)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 58

Expert Comment

by:Gary
ID: 40515696
robots.txt are not being obeid by all search bots
And having 1000's of lines of blocking code for all the bad ones will do you no good either ;o)
0
 
LVL 4

Expert Comment

by:hulsebosch
ID: 40515715
Youve just got yourself a very good point ;-)
0
 

Author Comment

by:Ikky786
ID: 40565582
im bit confused, are we saying its not possible?
0
 
LVL 58

Expert Comment

by:Gary
ID: 40565612
I gave you the answer in the very first comment
0
 
LVL 4

Expert Comment

by:hulsebosch
ID: 40566288
When considering your question and remark
The key thing is that NOBODY from anywhere...
Indeed, the first comment from Gary is the way to establish this.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Blog posts not showing up on Blog page 7 52
CSS measurement 10 34
JavaScript: Issue with onClick 5 36
Bad <form> statement? 9 25
This article discusses how to create an extensible mechanism for linked drop downs.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now