Welcome Guest, Not a member yet? Register   Sign In
How do I protect my development site with .htaccess
#1

[eluser]RMinor[/eluser]
I have a website that I am developing for a client. He wants the entire website to be invisible to random users / search engines. I figured .htaccess with a .htpasswd was the way to go. My problem is that I am getting an internal server error after I enter the username and password. How can I get this to work so that him or I can enter the username and password and the site works as normal? Below are my files.

This is the .htaccess file:
Code:
AuthType Basic
AuthName "Test Site"
AuthUserFile /home/content/p/i/n/html/digrepro/.htpasswd
Require valid-user


# Options
Options -Multiviews
Options +FollowSymLinks

#Enable mod rewrite
RewriteEngine On
#the location of the root of your site
#if writing for subdirectories, you would enter /subdirectory
RewriteBase /

#Removes access to CodeIgniter system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

#This last condition enables access to the images and css
#folders, and the robots.txt file
RewriteCond $1 !^(index\.php|images|robots\.txt|css|products|js)

RewriteRule ^(.*)$ index.php?/$1 [L]

Both the .htaccess and .htpasswd files reside in the web root folder.


Messages In This Thread
How do I protect my development site with .htaccess - by El Forum - 05-01-2012, 09:00 AM
How do I protect my development site with .htaccess - by El Forum - 05-01-2012, 09:29 AM
How do I protect my development site with .htaccess - by El Forum - 05-01-2012, 09:35 AM
How do I protect my development site with .htaccess - by El Forum - 05-01-2012, 09:46 AM
How do I protect my development site with .htaccess - by El Forum - 05-01-2012, 10:02 AM
How do I protect my development site with .htaccess - by El Forum - 05-01-2012, 10:11 AM
How do I protect my development site with .htaccess - by El Forum - 05-01-2012, 04:40 PM
How do I protect my development site with .htaccess - by El Forum - 05-02-2012, 12:02 PM
How do I protect my development site with .htaccess - by El Forum - 05-02-2012, 12:12 PM
How do I protect my development site with .htaccess - by El Forum - 05-02-2012, 12:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB