Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How do I completely protect my site via HTACCESS?  (Read 6227 times)

0 Members and 1 Guest are viewing this topic.

Zylstra

    Topic Starter
  • Moderator


  • Hacker

  • The Techinator!
  • Thanked: 45
    • Yes
    • Technology News and Information
  • Certifications: List
  • Computer: Specs
  • Experience: Guru
  • OS: Windows 7
How do I completely protect my site via HTACCESS?
« on: May 22, 2007, 12:45:35 PM »
My current HTACCESS file looks like this

Code: [Select]
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://www.mywebsite.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mywebsite.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://mywebsite.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://mywebsite.com$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

I would like to make it so that the entire website is password protected. How would I do that?


« Last Edit: May 25, 2007, 02:16:27 PM by Zylstra »

The Saviour

  • Guest
Re: How do I completely protect my site via HTACCESS?
« Reply #1 on: June 07, 2007, 10:15:57 AM »
Zylstra...

Depending on your host...

If you have a Control Panel you can log into...supplied by your host...you may be able to log into it and look for a link to password protect your directories.

I use cPanel X...supplied by my host.  I have a link as I specified before...and I can select the root directory, public_html, and password protect it.  If anyone wants access to the site...they'll need the password.

Hope this helped.

Zylstra

    Topic Starter
  • Moderator


  • Hacker

  • The Techinator!
  • Thanked: 45
    • Yes
    • Technology News and Information
  • Certifications: List
  • Computer: Specs
  • Experience: Guru
  • OS: Windows 7
Re: How do I completely protect my site via HTACCESS?
« Reply #2 on: June 07, 2007, 06:22:52 PM »
I'll check it out, I dont think I can protect the /public_html/ using my cPanel version 11 (newest version) but I will try


Zylstra

    Topic Starter
  • Moderator


  • Hacker

  • The Techinator!
  • Thanked: 45
    • Yes
    • Technology News and Information
  • Certifications: List
  • Computer: Specs
  • Experience: Guru
  • OS: Windows 7
Re: How do I completely protect my site via HTACCESS?
« Reply #3 on: June 07, 2007, 06:32:44 PM »
Changing my mind, I am using cPanel X 10.9.0-RELEASE 7965

I cannot access my root directory using my pay-for hosting service, but I have a free one that has cPanel 11, which does allow me to, meaning that I have to do it manually...
How would I go about doing this, and which folder do I place it in?

The Saviour

  • Guest
Re: How do I completely protect my site via HTACCESS?
« Reply #4 on: June 07, 2007, 08:36:09 PM »
Zylstra...

Yes, you can password protect your public_html directory.

Log into CPanel...navigate to Password Protect Directories.

Look for the public_html folder...you'll see a "/" without the quotes next to it.  Click it.  You'll be able to configure the password protection on the page that comes up.

Hope you found that useful.

Zylstra

    Topic Starter
  • Moderator


  • Hacker

  • The Techinator!
  • Thanked: 45
    • Yes
    • Technology News and Information
  • Certifications: List
  • Computer: Specs
  • Experience: Guru
  • OS: Windows 7
Re: How do I completely protect my site via HTACCESS?
« Reply #5 on: June 08, 2007, 02:09:12 PM »
!!
My timeline:
 :'( :-\ :-[ :-X :( :o :) :D ;D

Thanks "The Saviour"!
I think this will solve my problems!

The Saviour

  • Guest
Re: How do I completely protect my site via HTACCESS?
« Reply #6 on: June 08, 2007, 02:17:04 PM »
You're welcome, Zylstra.

Zylstra

    Topic Starter
  • Moderator


  • Hacker

  • The Techinator!
  • Thanked: 45
    • Yes
    • Technology News and Information
  • Certifications: List
  • Computer: Specs
  • Experience: Guru
  • OS: Windows 7
Re: How do I completely protect my site via HTACCESS?
« Reply #7 on: June 10, 2007, 03:00:42 PM »
Okay, its working great! Thanks

One quick question:
Is it possible to unprotect a sub directory?
Like, the /public_html/ is protected, but I want
/public_html/imageshare/files/ to be unprotected. Is this possible?

The Saviour

  • Guest
Re: How do I completely protect my site via HTACCESS?
« Reply #8 on: June 11, 2007, 10:38:15 PM »
Not positive, but I think once you pw protect the root, you won't be able to access a sub directory.

Something you might want to talk to your host about.