Myreader.co.uk  
uk news, chat and community
   home   |   control panel login   |   archive   |  
 
net
net
news.announce
news.config
news.management
news.moderation
providers
providers.aaisp
web.authoring
  
 
date: Tue, 05 Aug 2008 09:44:25 +0100,    group: uk.net.web.authoring        back       
htaccess question   
Can I restrict only html files to authorised valid users, but allow 
images in a sub-directory to be viewed by anyone? If so, could some kind 
htaccess wizard post the code I'd need to put in my .htaccess file?
date: Tue, 05 Aug 2008 09:44:25 +0100   author:   treadmill-- with the great taste of fish nope

Re: htaccess question   
On Tue, 05 Aug 2008 09:44:25 +0100, treadmill-- with the great taste
of fish <nope> wrote:

>Can I restrict only html files to authorised valid users, but allow 
>images in a sub-directory to be viewed by anyone? If so, could some kind 
>htaccess wizard post the code I'd need to put in my .htaccess file?

You just need to condition the standard require within FilesMatch,
e.g.

<FilesMatch "\.(html)$">
require ...
</FilesMatch>
date: Thu, 07 Aug 2008 21:03:51 +0100   author:   Stuart Millington

Re: htaccess question   
Stuart Millington wrote:
> On Tue, 05 Aug 2008 09:44:25 +0100, treadmill-- with the great taste
> of fish <nope> wrote:
> 
>> Can I restrict only html files to authorised valid users, but allow 
>> images in a sub-directory to be viewed by anyone? If so, could some kind 
>> htaccess wizard post the code I'd need to put in my .htaccess file?
> 
> You just need to condition the standard require within FilesMatch,
> e.g.
> 
> <FilesMatch "\.(html)$">
> require ...
> </FilesMatch>

Brilliant! Worked a treat. Cheers, Stuart, that's a pint I owe you.
date: Fri, 08 Aug 2008 07:40:57 +0100   author:   treadmill-- with the great taste of fish nope

Re: htaccess question   
"Stuart Millington"  wrote in message 
news:m6lm94ddis2gg5qon4vlstmk03dnrvhfb3@4ax.com...
> On Tue, 05 Aug 2008 09:44:25 +0100, treadmill-- with the great taste
> of fish <nope> wrote:
>
>>Can I restrict only html files to authorised valid users, but allow
>>images in a sub-directory to be viewed by anyone? If so, could some kind
>>htaccess wizard post the code I'd need to put in my .htaccess file?
>
> You just need to condition the standard require within FilesMatch,
> e.g.
>
> <FilesMatch "\.(html)$">
> require ...
> </FilesMatch>

Where do you put that?

Also I assume that once you use it, it then gives access to everything 
_except_ the file type in the FilesMatch. Am I right?

-dE|_---
Getting ready to rumble at Reading.
date: Wed, 20 Aug 2008 14:29:52 +0100   author:   dE|_

Re: htaccess question   
dE|_ wrote:
> "Stuart Millington"  wrote in message 
> news:m6lm94ddis2gg5qon4vlstmk03dnrvhfb3@4ax.com...
>> On Tue, 05 Aug 2008 09:44:25 +0100, treadmill-- with the great taste
>> of fish <nope> wrote:
>>
>>> Can I restrict only html files to authorised valid users, but allow
>>> images in a sub-directory to be viewed by anyone? If so, could some kind
>>> htaccess wizard post the code I'd need to put in my .htaccess file?
>> You just need to condition the standard require within FilesMatch,
>> e.g.
>>
>> <FilesMatch "\.(html)$">
>> require ...
>> </FilesMatch>
> 
> Where do you put that?

Assuming yours is a Linux server, in the .htaccess file inside the 
directory you wish to protect. You'll also need the authorisation stuff, 
e.g.:

	
	AuthType Basic
	AuthName "restricted area"
	AuthUserFile /var/etc/.htpasses
	# or similar, then...

	<FilesMatch "\.(html|htm)$">
	  require valid-user
	</FilesMatch>

	Order Allow,Deny
	Allow from all

> 
> Also I assume that once you use it, it then gives access to everything 
> _except_ the file type in the FilesMatch. Am I right?

Yep. And if you know about regular expressions - they make my head hurt 
too much so I don't! - you can do all sorts of clever stuff.
date: Wed, 20 Aug 2008 16:54:45 +0100   author:   treadmill-- with the great taste of fish nope

Google
 
Web myreader.co.uk


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us