Free access to folders in . htaccess

Asked

Viewed 2,619 times

1

First of all I want to say that I have already researched here in the stack and none of the examples helped me. However if you think it is duplicated please indicate the solution link.

I have configured . htaccess for ZEND 1.12 in an application

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

Then when accessing a link from an image of the error saying that the controller is invalid. Because the sequence of the url is /controller/action/param/123

Ex:

http://localhost:85/img/catalog/paisagem.jpg4

I know this is due to the fact that it is not released for access to the IMG/CATALOG folder in . htaccess tried to do some examples and none worked, one I tried worked, showed the image but zend was not configured to access normally then I had to go back and put the same code up for the site to work again.

Any suggestions?

1 answer

3


Believe that I was working with a framework and had this same problem 2 hours, rs

If I understand what you asked, so that the informed folder is not affected by mod_rewrite you must add a new .htaccess inside the briefcase img for example, what should be the content of .htaccess:

<IfModule mod_rewrite.c>
RewriteEngine Off
</IfModule>

Example of folder structure:

.
├── img
|   ├── .htaccess (arquivo para liberar acesso desta pasta)
|   └── catalog
|       └── paisagem.jpg4
├── .htaccess (arquivo usado pelo zend)
└── index.php
  • VLWWWWW!!!! certinho!! and to protect that is not listed all images I added a blank index.html. I want to be seen only the image I put in the link. Finally solved here. Thanks!

  • @rafaelphp The index.html tactic is very good indeed.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.