4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu
Please consider registering: registration is fast, easy and free! Benefits of registration:
  • Free advertising for your website: Every post in our forums goes towards a "credit" of ads, which are displayed on most pages of our forums. Each post gives you 400 ad impressions. To submit your ad, edit your profile.
  • Discount at TemplateMonster: All our members enjoy a 10% discount at TemplateMonster.com!
  • Private Messages: Exchange private messages with other members of the forums.
  • Message Tracking/Subscription: phpBB enables you to subscribe to threads which interest you, and will then email you when a reply is posted. phpBB also remembers which posts registered users have read during a session, which means you can keep track of which posts you have already looked at.

 .htaccess and Custom ErrorDocuments
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
RickNTpa
Junior WebHelper
Junior WebHelper


Joined: 18 Dec 2006
Posts: 1

PostPosted: Mon Dec 18, 2006 2:15 pm (7 years, 7 months ago) Reply with QuoteBack to Top

Hi,

I am trying to get some password protection into some of my pages.

I created the .htaccess file and I am using the mysql mod to control access by using a MySQL table.

That portion is working....

Now I tried to implement a custom error document so that if the person doesn't have a user/pwd setup, they will fail to authenticate and then get rerouted to my custom page...

The code is in place, however now instead of first asking for the userid/pwd, it goes right to the custom error page.. I can test this by commenting out that custom "ErrorDocument" line to test...

Here's my .htaccess file...

<Files>
order allow,deny
deny from all
</Files>

SetEnvIfNoCase User-Agent "^EmailSiphon" bad_bot
SetEnvIfNoCase User-Agent "^EmailWolf" bad_bot
SetEnvIfNoCase User-Agent "^ExtractorPro" bad_bot
SetEnvIfNoCase User-Agent "^CherryPicker" bad_bot
SetEnvIfNoCase User-Agent "^NICErsPRO" bad_bot
SetEnvIfNoCase User-Agent "^Teleport" bad_bot
SetEnvIfNoCase User-Agent "^EmailCollector" bad_bot


AuthName "By Invitation Only"
AuthType Basic
AuthGroupFile /dev/null
AuthMySQLEnable On
AuthMySQLHost localhost
AuthMySQLDB <dbname>
AuthMySQLUserTable <tablename>
AuthMySQLUser <username>
AuthMySQLPassword <userpwd>
AuthMySQLPwEncryption none
AuthMySQLSaltField none
AuthMySQLNoPasswd Off
AuthMySQLAuthoritative On

<Limit>
require valid-user
Order Deny,Allow
Allow from all
Deny from env=bad_bot
</Limit>

ErrorDocument 403 /errorpages/Error401403.cfm
ErrorDocument 401 /errorpages/Error401403.cfm


If I comment out the 401 ErrorDocument, it prompts for the userid/pwd and if it is wrong, it will redirect to the apache Authorization Required page that is default with Apache... If I uncomment out the 401 above, it goes immediately to the 401 redirect page without prompting first for the user/pwd combo....

What am I doing wrong???

Thanks,
RickNTpa
OfflineView User's ProfileFind all posts by RickNTpaSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.

PoignantEase
Web design, coding, script installation, phpBB customisation - From a 4WebHelp team member



Page generation time: 0.070727 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme