Silicon Valley North

Web Directory Options


Creating Customized Error Documents

  1. By using a .htaccess file, you can change various parameters about how your web directories and documents function. This file gives you the ability to create customized error documents (document not found, access denied, etc.) for your web site.

  2. Create a file called .htaccess and place it in your web documents directory (/home/htdocs/loginname or ~loginname/public_html). This is where you will place the locations of your error documents. An example .htaccess file can be found below.

    ErrorDocument 403 http://www.svn.net/your_username/403.html
    ErrorDocument 404 http://www.svn.net/your_username/404.html
    or
    ErrorDocument 403 http://www.yourdomain.com/error.html

    The three-digit number in the second column represents the server error-code for the error you are creating a document for. The two most common error codes are 403 - Access Denied, and 404 - Not Found. A complete list of error codes can be found here.

  3. Create the error document files you are calling from the .htaccess file. (ie. http://www.svn.net/your_username/404.html)

  4. The error documents you specified will now display when the corresponding error is encountered in your web site.

Password Protecting Web Pages

  1. In the following instructions, your_username should be replaced with your SVN username. webuser can be any name you choose, it doesn't have to be "webuser" and shouldn't be your SVN username.

  2. The first step to password your web page(s) is to create a file called .htaccess in the directory you wish to have password protected. (public_html/private is used as an example in this document) If you already have this file for custom error documents, you may append this information to the end of the file. An example .htaccess file for password authentication can be found below.

    AuthUserFile /home/htdocs/your_username/private/.htpasswd
    AuthGroupFile /dev/null
    AuthName "Enter Name Here"
    AuthType Basic

    <Limit GET>
    require valid-user
    </Limit>

  3. In the above example, AuthName can be replaced with any text you would like. This text will appear in the password dialog box when the page is loaded.

  4. The next step will be to create the password file. In order to do this, you will need to log into your shell account. This can be done by connecting any telnet or ssh client to svn.net. After you log in and receive the command prompt ($), (make sure the "private" directory exists first) type the following command:
    htpasswd -c /home/htdocs/your_username/private/.htpasswd webuser
    This command will prompt you to enter the password twice. If you wish to later change the password, or add another password, run the htpasswd command again without the -c flag. You are now finished with your shell account, so type exit to close it.

  5. If you try and access http://www.svn.net/your_username/private, it should now prompt you for a username and password.


COPYRIGHT | CONTACT INFO | DISCLAIMER