image does not appear per rule in .htaccess

2

I have my .htaccess as follows:

<IfModule mod_rewrite.c>

    RewriteEngine on 
    RewriteCond %{REQUEST_FILENAME} -s [OR] 
    RewriteCond %{REQUEST_FILENAME} -t [OR] 
    RewriteCond %{REQUEST_FILENAME} -d 
    RewriteRule ^.$ - [NC,L] 
    RewriteRule ^(.*)$ index.php?/$1 [L]

    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?localhost/mvc [NC]
    RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]

    ErrorDocument 400 http://localhost/mvc/400.php
    ErrorDocument 401 http://localhost/mvc/401.php
    ErrorDocument 403 http://localhost/mvc/403.php
    ErrorDocument 404 http://localhost/mvc/404.php
    ErrorDocument 500 http://localhost/mvc/500.php

</IfModule>

php_value allow_url_fopen on
php_value allow_url_include on
php_flag mail_filter 0

As it stands, and I believe the problem is here:

RewriteRule ^.$ - [NC,L] 
RewriteRule ^(.*)$ index.php?/$1 [L]

No I'm able to display imagens because all link needs to go through the index.php page for the rule I'm using.

I tried to put the absolute path of the image but it did not resolve either.

My objects in this .htaccess are:

1) All requisição must reach index.php

2) That the imagens appear normally ( NOT ) is link error because when I disabled in .htaccess the two above lines the imagem appears in the browser.)

3) Can you optimize this .htaccess ?

    
asked by anonymous 15.06.2018 / 18:11

0 answers