cancel
Showing results for 
Search instead for 
Did you mean: 

htaccess on CCGI (MediaWiki)

epitrope
Newbie
Posts: 8
Registered: ‎31-05-2008

htaccess on CCGI (MediaWiki)

We've been trying to follow the instructions for securing MediaWiki images at
http://www.mediawiki.org/wiki/Manual:Image_Authorization#Apache_Instructions_without_PATH_INFO_with_...
on CCGI.  Unfortunately we've had a problem with denying access to pages; the .htaccess file with "deny from all" does not work.  PNG files are happily still served by the server (note this is not the PHP problem others have mentioned and we've also tried added an "order" statement).  We know the htaccess file is being read as if we put a corrupt entry in the file we get a "500 Internal Server Error".
Any ideas?
Thanks,
epitrope.
5 REPLIES 5
Peter_Vaughan
Grafter
Posts: 14,469
Registered: ‎30-07-2007

Re: htaccess on CCGI (MediaWiki)

Posting the relevant contents (masking any domains etc if you want) of your .htaccess may help as we have no idea what you have done.
epitrope
Newbie
Posts: 8
Registered: ‎31-05-2008

Re: htaccess on CCGI (MediaWiki)

I'm afraid it's nothing exciting at all - our .htaccess contains only
deny from all
As mentioned above the .htaccess is definitely being read as corrupting the files gives an internal server error - I guess this is similar functionality to "deny from all" but doesn't seem the right way to do things!
Thanks,
epitrope.
Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: htaccess on CCGI (MediaWiki)

Unfortunately blocking access with .htaccess won't work for php on our CGI platform, as we don't use the Apache mod_php extension but run php scripts as CGI. This means that apache specific settings such as those found in .htaccess are not honoured.
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: htaccess on CCGI (MediaWiki)

Sorry to differ. Blocking access with .htaccess will work on CCGI. It's only PHP-specific settings that aren't honoured, not Apache directives in general.
Try something like:

<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh|pem|txt|png)$">
  Order Allow,Deny
  Deny from all
</FilesMatch>
IndexIgnore *

Gabe
epitrope
Newbie
Posts: 8
Registered: ‎31-05-2008

Re: htaccess on CCGI (MediaWiki)

Great - that worked fine.  Wouldn't have guessed the requirement to include the FilesMatch section!
Thanks,
epitrope.