[Question] Template Parse Error and .htaccess

Started by 127.0.0.1, January 01, 2007, 07:59:38 AM

Previous topic - Next topic

127.0.0.1

Question 1. Regarding Template Parse Errors

I noticed something in the 1.1.x version of SMF. When there is a template parse error, it shows a page like this:


Full Resolution IMG: http://i18.tinypic.com/47j9jd4.png

That never happened in my 1.0 version. Is that the new norm for template parse errors? I'd rather it not show detailed info like that if at all possible.

Question 2. Regarding .htaccess in the attachments directory

Throughout my site there are direct img tag calls to certain jpg's in the attachments directory. With the .htaccess file that comes with SMF, it will not display any direct calls to that directory, so I'm forced to delete the .htaccess file. However, I'd still like other files in that directory to be blocked as intended. Is there a way I can modify the .htaccess file to allow any requests for files in the format of avatar_*.thumb.jpg.

Grudge

127.0.0.1,

Only admins see the parse error information - normal users will just get an error message telling them there is a problem.

On point two I'm no expert no .htaccess so I'll let someone else answer - should be possible though.
I'm only a half geek really...

niko

Quote from: 127.0.0.1 on January 01, 2007, 07:59:38 AM
Question 2. Regarding .htaccess in the attachments directory

Throughout my site there are direct img tag calls to certain jpg's in the attachments directory. With the .htaccess file that comes with SMF, it will not display any direct calls to that directory, so I'm forced to delete the .htaccess file. However, I'd still like other files in that directory to be blocked as intended. Is there a way I can modify the .htaccess file to allow any requests for files in the format of avatar_*.thumb.jpg.

Yes. You can use FilesMatch (Apache 2) or <Files> (Apache 1.3) section.

See: http://httpd.apache.org/docs/1.3/mod/core.html#files


Websites: Madjoki || (2 links retracted by team, links out of date and taken over.)
Mods: SMF Arcade, Related topics, SMF Project Tools, Post History

WIP Mods: Bittorrent Tracker || SMF Wiki

127.0.0.1


127.0.0.1

The original .htaccess file looks like this
<Files *>
Order Deny,Allow
Deny from all
Allow from localhost
</Files>


To build upon the original but allow access to *.thumb.jpeg|jpg|gif|png files would the new .htaccess file look like this?

<Files *>
Order Deny,Allow
Deny from all
Allow from localhost
</Files>

<FilesMatch "\thumb.(gif|jpe?g|png)$">
Order Allow,Deny
</FilesMatch>

niko

Something like

<FilesMatch "^(thumb.(gif|jpe?g|png)$)">
Order Allow, Deny
        Deny from all
        Allow from localhost
</FilesMatch>


should match everything but thumbnails
Websites: Madjoki || (2 links retracted by team, links out of date and taken over.)
Mods: SMF Arcade, Related topics, SMF Project Tools, Post History

WIP Mods: Bittorrent Tracker || SMF Wiki

127.0.0.1

Hmm. That did not work. It blocked direct access to images containing *.thumb.* file names.

Example filename that gets blocked: avatar_227.thumb.jpg

Advertisement: