17 Design placement icon

BLOG

401 Errors - Authorized Users Only

Unlike a 404 error, the 401 is uncommonly seen and usually refers to secure web pages. For example, entry into the back-end maintenance of an on-line database for many websites will require logging in through a login screen. If programmed correctly, each page you visit after that point should check if the user has a valid id and password. If not, a 404 error should be generated and the unauthorized user should receive notification to that effect.

To force 404 errors to display a specific page requires the web master of your website to modify the .htaccess file. Similar in code to the 401 error, on a Unix server one would enter the following:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^17designs.com [NC]
RewriteRule ^(.*)$ http://www.17designs.com/$1 [L,R=301]
ErrorDocument 401 http://www.17designs.com/401.php

For static pages, replace 401.php with 401.html. Be sure to create a 401 page with content that explains how the website visitor reached a page they are not authorized to view.

by: Creative

«Back»

Protect your website investment with Internet security tips. View BLOG information about Internet development and web design.