Protecting /Catalog

Tagged: ,

This topic has been marked as not a support question.

Hi,

I have been testing out with .htaccess on the catalog folder in hope to improve the security access of it but I notice a drop in performance especially when loading stylesheets from the /catalog folder. Can I know if it is common for admins to protect the /catalog folder?

My htaccess as follow

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !^(.+)\.jpg$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.jpeg$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.png$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.gif$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.css$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.js$
RewriteRule ^(.+)$ /404.html [NC]

I’m not entirely sure if I should put my question here but since it relates to css I thought here might be a good place to start.

Any input would be appreciated.

Thanks.

 3antz
December 11, 2011 at 5:44 pm #4403

Hmm, I see what you are trying to achieve, but I don’t think mod rewrite is necessary here. You can try the following:

deny from all
<Files ~ "\.(?i:gif|jpe?g|png|css|js)$">
order deny,allow
allow from all
</Files>

Copy the above code in your .htaccess in the catalog folder, replacing the old one. See if this improves your performance and let us know.

Regards,
ThemeBurn team

December 16, 2011 at 11:35 am #4545

sorry for getting back to you late on this, but it seems that performance is still affected.
without the htaccess it is the quickest followed by your suggestion and the one I have was the slowest of all.

I’ll forward this question to the oc forums since this i doubt this is theme related but I do appreciate your input on this.

 3antz
December 22, 2011 at 4:47 am #4670

You better ask no the forums I think. I use this .htaccess for a directory with thousands of subdirectories without notable effect on performance. Post here, if you find something interesting.

December 22, 2011 at 10:16 am #4671
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.