Page 1 of 1

.htaccess in /catalog/ blocks templates and website is funky

Posted: Thu Nov 03, 2011 4:30 am
by average_joe
I've seen to enter this text in the /catalog folder to add more protection for your store.

Code: Select all

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 enter it, and my store acts as if there is no template or something.
Everything falls out of place.

Is there something I missed?

Re: .htaccess in /catalog/ blocks templates and website is f

Posted: Thu Nov 03, 2011 4:32 am
by uksitebuilder
well you have just blocked access to all your images, javascript and css files

can't see why you would want to do that

Re: .htaccess in /catalog/ blocks templates and website is f

Posted: Thu Nov 03, 2011 4:51 am
by average_joe
What is it exactly i'm supposed to do to protect my .php files, so people cannot access them or see them?

Re: .htaccess in /catalog/ blocks templates and website is f

Posted: Thu Nov 03, 2011 5:42 am
by uksitebuilder
I cant see why - php files will not be downloadable

However, if you must, you can try this in htaccess

Code: Select all

Order Deny,Allow
Deny from all

<Files /index.php>
    Order Allow,Deny
    Allow from all
</Files>


<Files /admin/index.php>
    Order Allow,Deny
    Allow from all
</Files>

<FilesMatch "*\.(jpg|jpeg|gif|png|bmp|css|js)$">
    Order Allow,Deny
    Allow from all
</FilesMatch>

Re: .htaccess in /catalog/ blocks templates and website is f

Posted: Thu Nov 03, 2011 6:07 am
by average_joe
it still does the same thing, i think i'm doing something wrong.
i'm only wondering because i saw this post before

http://forum.opencart.com/viewtopic.php ... 8&p=200225

Re: .htaccess in /catalog/ blocks templates and website is f

Posted: Wed Nov 09, 2011 6:20 am
by average_joe
anyone?