Forums / Setup & design / .htaccess help

.htaccess help

Author Message

Softriva .com

Friday 02 April 2010 1:58:27 am

what are these lines for in .htaccess

<FilesMatch ".">
order allow,deny
deny from all
</FilesMatch>

<FilesMatch "(^index\.php|favicon\.ico|index_treemenu\.php|\.(gif|jpe?g?|png|css|js|swf|html?)|var(.+)storage.pdf(.+)\.pdf)$">
order allow,deny
allow from all
</FilesMatch>

Bertrand Dunogier

Friday 02 April 2010 2:35:54 am

The first, FilesMatch "." will deny access to every file. I would by the way say this is wrong, since . will only match any character once... and it is not likely that we will have files with one letter names :)

The next one will allow access to known ezpublish files, only the ones that can be directly requested from the browser.

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

Softriva .com

Friday 02 April 2010 5:19:12 am

Should I remove the first part from .htaccess?

Thx

Bertrand Dunogier

Friday 02 April 2010 6:08:24 am

Nope, but you can fix it by replacing "." with ".+"

Actually I need to start thinking straight: "." will match any file, no need for a + here, since there are no ^ nor $. So you can leave it as it is, it is correct.

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier