miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Specific miniBB Support Forums / Specific /  
 

Protected directory with htaccess

 
Author Jaime
Partaker
#1 | Posted: 2 Oct 2013 12:33 
Something else;-) A directory should be protected. Has access to only one user at a particular IP AND having to log in addition to username and password.

If no problem :)

But everyone already comes with a non-matching IP ... should not even be prompted to enter username and password! He should simply forwarded to another page.

Since i am currently on the tube and do not get out that with .htaccess

My attempt was:

RewriteCond %{REMOTE_HOST} !^xxx\.xxx\.xxx\.xxx
RewriteRule ^(.*)$ myurl/? [R=301,L]

AuthType Basic
...

Was it not so that rewriting is performed before authorization?

So I'm looking for this solution and .. Is that even possible via htaccess?

Incorrect IP - redirect
Correct IP - allow AND check authorization

Author Paul
Lead Developer 
#2 | Posted: 2 Oct 2013 13:56 
How this could be related to miniBB?

Author Jaime
Partaker
#3 | Posted: 2 Oct 2013 14:24 
No Paul, has nothing to do with miniBB.

Author Paul
Lead Developer 
#4 | Posted: 2 Oct 2013 20:45 
Then may be it would be useful to ask .htaccess-related questions on the Apache-related forum :-) Because it truly depends on many factors, how to do this, it also depends on your customization of server settings. Even pre-existing codes may work differently on various servers, I can't even suggest something theoretical, it should be developed on your server only. No aside advice is possible, I guess.

Author Jaime
Partaker
#5 | Posted: 4 Oct 2013 10:44 
Sure there would be also a good place to ask ... but there is certainly one or the other of possibly had a tip for me :)

And the solution i've probably found yourself, i just need enclose the authorization with a <FilesMatch "."> block, also

RewriteCond ...
...

<FilesMatch ".">
AuthType Basic
...
</FilesMatch>

Now it works (by me!) , Incorrect IP - redirect and no display of the authorization area, Correct IP - allow AND display/check the authorization area. My question has been resolved and my curiosity has been satisfied with it :)

Specific miniBB Support Forums / Specific /
 Protected directory with htaccess
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Get the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑